[Mesa-dev] [PATCH] glsl: Support unsigned integer constants in layout qualifiers.

Kenneth Graunke kenneth at whitecape.org
Mon Nov 19 22:37:41 PST 2012


Fixes es3conform's explicit_attrib_location_integer_constants.
---
 src/glsl/glsl_parser.yy | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 89175f5..f123368 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -241,6 +241,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: 
@@ -1084,6 +1085,10 @@ layout_qualifier_id_list:
 	}
 	;
 
+integer_constant:
+	INTCONSTANT { $$ = $1; }
+	| UINTCONSTANT { $$ = $1; }
+
 layout_qualifier_id:
 	any_identifier
 	{
@@ -1155,7 +1160,7 @@ layout_qualifier_id:
 	      YYERROR;
 	   }
 	}
-	| any_identifier '=' INTCONSTANT
+	| any_identifier '=' integer_constant
 	{
 	   memset(& $$, 0, sizeof($$));
 
-- 
1.8.0



More information about the mesa-dev mailing list