$$->identifier = $2;
state->symbols->add_variable(new(state) ir_variable(NULL, $2, ir_var_auto));
}
+ | 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;
+ }
+ }
| type_specifier any_identifier array_specifier
{
void *ctx = state->linalloc;
ctx->Const.AllowGLSLExtensionDirectiveMidShader;
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;
bool allow_extension_directive_midshader;
bool allow_builtin_variable_redeclaration;
+ bool allow_layout_qualifier_on_function_parameter;
/**
* Known subroutine type declarations.
*/
GLboolean AllowHigherCompatVersion;
+ /**
+ * Allow layout qualifiers on function parameters.
+ */
+ GLboolean AllowLayoutQualifiersOnFunctionParameters;
+
/**
* Force computing the absolute value for sqrt() and inversesqrt() to follow
* D3D9 when apps rely on this behaviour.