From ea83fd912423ac0247395f5c1ccabe94cd95ee24 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Thu, 29 Oct 2020 17:06:44 +1100 Subject: [PATCH] glsl: drop NMS OpenGL workarounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No Mans Sky dropped its OpenGL backend on April 16, 2019 in favour of its Vulkan backend. So here we drop the old OpenGL workarounds. Reviewed-by: Marek Olšák Part-of: --- src/compiler/glsl/glsl_parser.yy | 16 ++-------------- src/compiler/glsl/glsl_parser_extras.cpp | 2 -- src/compiler/glsl/glsl_parser_extras.h | 1 - .../auxiliary/pipe-loader/driinfo_gallium.h | 1 - src/gallium/frontends/dri/dri_screen.c | 2 -- src/gallium/include/frontend/api.h | 1 - src/mesa/main/mtypes.h | 5 ----- src/mesa/state_tracker/st_extensions.c | 3 --- src/util/00-mesa-defaults.conf | 8 -------- src/util/driconf.h | 4 ---- 10 files changed, 2 insertions(+), 41 deletions(-) diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy index ec2dd6a0513..e6ed70176c3 100644 --- a/src/compiler/glsl/glsl_parser.yy +++ b/src/compiler/glsl/glsl_parser.yy @@ -917,20 +917,8 @@ parameter_declarator: } | layout_qualifier type_specifier any_identifier { - if (state->allow_layout_qualifier_on_function_parameter) { - void *ctx = state->linalloc; - $$ = new(ctx) ast_parameter_declarator(); - $$->set_location_range(@2, @3); - $$->type = new(ctx) ast_fully_specified_type(); - $$->type->set_location(@2); - $$->type->specifier = $2; - $$->identifier = $3; - state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto)); - } else { - _mesa_glsl_error(&@1, state, - "is is not allowed on function parameter"); - YYERROR; - } + _mesa_glsl_error(&@1, state, "is is not allowed on function parameter"); + YYERROR; } | type_specifier any_identifier array_specifier { diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index 48c0fc8f217..7daf65bef6d 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -321,8 +321,6 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, ctx->Const.AllowGLSL120SubsetIn110; this->allow_builtin_variable_redeclaration = ctx->Const.AllowGLSLBuiltinVariableRedeclaration; - this->allow_layout_qualifier_on_function_parameter = - ctx->Const.AllowLayoutQualifiersOnFunctionParameters; this->cs_input_local_size_variable_specified = false; diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h index e475e18fdd9..efd9e05f4d5 100644 --- a/src/compiler/glsl/glsl_parser_extras.h +++ b/src/compiler/glsl/glsl_parser_extras.h @@ -943,7 +943,6 @@ struct _mesa_glsl_parse_state { bool allow_extension_directive_midshader; bool allow_glsl_120_subset_in_110; bool allow_builtin_variable_redeclaration; - bool allow_layout_qualifier_on_function_parameter; /** * Known subroutine type declarations. diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h index 41051bc6447..f90112f25d9 100644 --- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h +++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h @@ -32,7 +32,6 @@ DRI_CONF_SECTION_DEBUG DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION(false) DRI_CONF_FORCE_GLSL_ABS_SQRT(false) DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD(false) - DRI_CONF_ALLOW_GLSL_LAYOUT_QUALIFIER_ON_FUNCTION_PARAMETERS(false) DRI_CONF_ALLOW_DRAW_OUT_OF_ORDER(false) DRI_CONF_FORCE_COMPAT_PROFILE(false) DRI_CONF_FORCE_GL_NAMES_REUSE(false) diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c index 0e9f39170e2..4de366f452a 100644 --- a/src/gallium/frontends/dri/dri_screen.c +++ b/src/gallium/frontends/dri/dri_screen.c @@ -95,8 +95,6 @@ dri_fill_st_options(struct dri_screen *screen) driQueryOptionb(optionCache, "force_glsl_abs_sqrt"); options->allow_glsl_cross_stage_interpolation_mismatch = driQueryOptionb(optionCache, "allow_glsl_cross_stage_interpolation_mismatch"); - options->allow_glsl_layout_qualifier_on_function_parameters = - driQueryOptionb(optionCache, "allow_glsl_layout_qualifier_on_function_parameters"); options->allow_draw_out_of_order = driQueryOptionb(optionCache, "allow_draw_out_of_order"); options->force_gl_names_reuse = diff --git a/src/gallium/include/frontend/api.h b/src/gallium/include/frontend/api.h index d4f47a1bfdc..038e21199f9 100644 --- a/src/gallium/include/frontend/api.h +++ b/src/gallium/include/frontend/api.h @@ -231,7 +231,6 @@ struct st_config_options bool vs_position_always_invariant; bool force_glsl_abs_sqrt; bool allow_glsl_cross_stage_interpolation_mismatch; - bool allow_glsl_layout_qualifier_on_function_parameters; bool allow_draw_out_of_order; bool force_integer_tex_nearest; bool force_gl_names_reuse; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index b3de4427ded..27cc5c961a0 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3870,11 +3870,6 @@ struct gl_constants */ GLboolean AllowHigherCompatVersion; - /** - * Allow layout qualifiers on function parameters. - */ - GLboolean AllowLayoutQualifiersOnFunctionParameters; - /** * Allow extra tokens at end of preprocessor directives. The CTS now tests * to make sure these are not allowed. However, previously drivers would diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 38370e1e6d6..7343c4777f4 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -1426,9 +1426,6 @@ void st_init_extensions(struct pipe_screen *screen, if (options->allow_glsl_relaxed_es) consts->AllowGLSLRelaxedES = GL_TRUE; - if (options->allow_glsl_layout_qualifier_on_function_parameters) - consts->AllowLayoutQualifiersOnFunctionParameters = GL_TRUE; - consts->MinMapBufferAlignment = screen->get_param(screen, PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT); diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf index 816169b40c3..ca38c7da2e1 100644 --- a/src/util/00-mesa-defaults.conf +++ b/src/util/00-mesa-defaults.conf @@ -241,11 +241,6 @@ TODO: document the other workarounds.