aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/compiler/glsl/glsl_parser.yy9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
index 8d6c47fb6a3..b91c24ebe97 100644
--- a/src/compiler/glsl/glsl_parser.yy
+++ b/src/compiler/glsl/glsl_parser.yy
@@ -2538,6 +2538,15 @@ statement_list:
$$ = $1;
$$->link.insert_before(& $2->link);
}
+ | statement_list extension_statement
+ {
+ if (!state->allow_extension_directive_midshader) {
+ _mesa_glsl_error(& @1, state,
+ "#extension directive is not allowed "
+ "in the middle of a shader");
+ YYERROR;
+ }
+ }
;
expression_statement: