glsl: Disable ordering checks on most qualifiers for 420pack.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 15 Jul 2013 23:11:00 +0000 (16:11 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 18 Jul 2013 23:57:22 +0000 (16:57 -0700)
This makes the compiler accept invariant, storage, layout, and
interpolation qualifiers in any order when ARB_shading_language_420pack
is enabled.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/glsl_parser.yy

index 72bf560f07e1b0029d0d0d5ca07827cbaab45836..c31f5e264813fc5dfeaa2ebf25b16cc8e93c3637 100644 (file)
@@ -1369,7 +1369,7 @@ type_qualifier:
                           "with layout(...).\n");
       }
 
-      if ($2.flags.q.invariant) {
+      if (!state->ARB_shading_language_420pack_enable && $2.flags.q.invariant) {
          _mesa_glsl_error(&@1, state, "Interpolation qualifiers must come "
                           "after \"invariant\".\n");
       }
@@ -1409,7 +1409,8 @@ type_qualifier:
       if ($2.has_storage())
          _mesa_glsl_error(&@1, state, "Duplicate storage qualifier.\n");
 
-      if ($2.flags.q.invariant || $2.has_interpolation() || $2.has_layout()) {
+      if (!state->ARB_shading_language_420pack_enable &&
+          ($2.flags.q.invariant || $2.has_interpolation() || $2.has_layout())) {
          _mesa_glsl_error(&@1, state, "Storage qualifiers must come after "
                           "invariant, interpolation, and layout qualifiers.\n");
       }