Mesa (master): glsl: Support unsigned integer constants in layout qualifiers.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Nov 27 05:06:42 UTC 2012


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Nov 19 22:36:28 2012 -0800

glsl: Support unsigned integer constants in layout qualifiers.

Fixes es3conform's explicit_attrib_location_integer_constants.

Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-and-tested-by: Matt Turner <mattst88 at gmail.com>

---

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

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index a066506..407dbbe 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -238,6 +238,7 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg)
 %type <node> conditionopt
 %type <node> for_init_statement
 %type <for_rest_statement> for_rest_statement
+%type <n> integer_constant
 %%
 
 translation_unit: 
@@ -1122,6 +1123,10 @@ layout_qualifier_id_list:
 	}
 	;
 
+integer_constant:
+	INTCONSTANT { $$ = $1; }
+	| UINTCONSTANT { $$ = $1; }
+
 layout_qualifier_id:
 	any_identifier
 	{
@@ -1191,7 +1196,7 @@ layout_qualifier_id:
 	      YYERROR;
 	   }
 	}
-	| any_identifier '=' INTCONSTANT
+	| any_identifier '=' integer_constant
 	{
 	   memset(& $$, 0, sizeof($$));
 




More information about the mesa-commit mailing list