Mesa (master): glsl: allow the #extension directive within code blocks for the dri option

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 12 15:38:05 UTC 2019


Module: Mesa
Branch: master
Commit: bd2995c8b78382c66c4a293c668ab7095958f824
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bd2995c8b78382c66c4a293c668ab7095958f824

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Tue Apr  9 18:15:34 2019 -0400

glsl: allow the #extension directive within code blocks for the dri option

for Viewperf 13

Acked-by: Timothy Arceri <tarceri at itsqueeze.com>

---

 src/compiler/glsl/glsl_parser.yy | 9 +++++++++
 1 file changed, 9 insertions(+)

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:




More information about the mesa-commit mailing list