[Mesa-dev] [PATCH] Revert "glsl: warning: pragma `invariant(all)' not supported in GLSL ES 1.00"

Kenneth Graunke kenneth at whitecape.org
Tue Jul 31 02:00:11 PDT 2012


This reverts commit e72f20641a6ea7875b6021aac13e778ada3b3d50.

The commit has two problems:
- The commit message itself quotes language from the GLSL ES 1.00
  specification that indicates that it /does/ support the invariant(all)
  pragma.  This appears to be the opposite of what the commit actually
  does.
- The check is wrong: state->Const.GLSL_100ES is set if the driver
  supports GLSL ES 1.00, but doesn't mean that the language version
  being parsed actually /is/ ES.  state->language_version == 100 is the
  right way to do that.

Cc: Oliver McFadden <oliver.mcfadden at linux.intel.com>
Cc: Eric Anholt <eric at anholt.net>
---
 src/glsl/glsl_parser.yy | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Am I just missing something here?  I read through the commit several times
trying to figure out what it was trying to do...it really seems to claim
 #pragma invariant(all) is NOT supported, while quoting spec text that
explicitly says it IS supported.  I'm confused.

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index f61d6b8..b2533c8 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 < 120) {
 	      _mesa_glsl_warning(& @1, state,
 				 "pragma `invariant(all)' not supported in %s",
 				 state->version_string);
-- 
1.7.11.3



More information about the mesa-dev mailing list