glsl: Support unsigned integer constants in layout qualifiers.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 20 Nov 2012 06:36:28 +0000 (22:36 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 27 Nov 2012 05:02:45 +0000 (21:02 -0800)
Fixes es3conform's explicit_attrib_location_integer_constants.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
src/glsl/glsl_parser.yy

index a0665067d74348f363edf9d30da557c11836aae8..407dbbeebccce72d5102b38cc7c32a1a9d9352df 100644 (file)
@@ -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($$));