Mesa (master): glsl: Fix #pragma invariant(all) language version check.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Jul 31 17:53:00 UTC 2012


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Jul 31 10:40:43 2012 -0700

glsl: Fix #pragma invariant(all) language version check.

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 at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/glsl_parser.yy |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index f61d6b8..9873934 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -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);




More information about the mesa-commit mailing list