diff options
Diffstat (limited to 'src/compiler/glsl/glsl_parser.yy')
-rw-r--r-- | src/compiler/glsl/glsl_parser.yy | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy index bc2571b6844..fd1592beca0 100644 --- a/src/compiler/glsl/glsl_parser.yy +++ b/src/compiler/glsl/glsl_parser.yy @@ -897,6 +897,23 @@ parameter_declarator: $$->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; |