glsl: allow the #extension directive within code blocks for the dri option
authorMarek Olšák <marek.olsak@amd.com>
Tue, 9 Apr 2019 22:15:34 +0000 (18:15 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 12 Apr 2019 15:34:39 +0000 (11:34 -0400)
for Viewperf 13

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/glsl_parser.yy

index 8d6c47f..b91c24e 100644 (file)
@@ -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: