glsl: Fix #pragma invariant(all) language version check.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 31 Jul 2012 17:40:43 +0000 (10:40 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 31 Jul 2012 17:52:54 +0000 (10:52 -0700)
It was using state->Const.GLSL_100ES, which is set if the driver
supports ARB_ES2_compatibility or we're in ES2 mode.  Instead, it should
use state->language_version, as that represents the actual GLSL version
of the shader being compiled.

Since the correct logic is < 120 && !100, just make it == 110.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/glsl_parser.yy

index f61d6b8..9873934 100644 (file)
@@ -301,7 +301,7 @@ pragma_statement:
        | PRAGMA_OPTIMIZE_OFF EOL
        | PRAGMA_INVARIANT_ALL EOL
        {
-          if (state->language_version < 120 && !state->Const.GLSL_100ES) {
+          if (state->language_version == 110) {
              _mesa_glsl_warning(& @1, state,
                                 "pragma `invariant(all)' not supported in %s",
                                 state->version_string);