glsl: add `unsigned int` type for EXT_GPU_shader4
authorMarek Olšák <marek.olsak@amd.com>
Tue, 7 Aug 2018 21:18:40 +0000 (17:18 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 25 Apr 2019 00:45:15 +0000 (20:45 -0400)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/glsl/glsl_lexer.ll
src/compiler/glsl/glsl_parser.yy

index f1426a9c486c736751420d68e25c27be5001e20f..d83e700f6fb49d6b8d88db6896b347d5c2868ff5 100644 (file)
@@ -612,7 +612,7 @@ short               KEYWORD(110, 100, 0, 0, SHORT_TOK);
 double         TYPE_WITH_ALT(130, 100, 130, 300, yyextra->ARB_gpu_shader_fp64_enable, glsl_type::double_type);
 half           KEYWORD(110, 100, 0, 0, HALF);
 fixed          KEYWORD(110, 100, 0, 0, FIXED_TOK);
-unsigned       KEYWORD(110, 100, 0, 0, UNSIGNED);
+unsigned       KEYWORD_WITH_ALT(110, 100, 0, 0, yyextra->EXT_gpu_shader4_enable, UNSIGNED);
 input          KEYWORD(110, 100, 0, 0, INPUT_TOK);
 output         KEYWORD(110, 100, 0, 0, OUTPUT);
 hvec2          KEYWORD(110, 100, 0, 0, HVEC2);
index b91c24ebe9706ef53254371c5a779c8875695b2a..9e9b49c8462ae97e81ea1911e334496b0931c1d4 100644 (file)
@@ -2308,7 +2308,16 @@ type_specifier_nonarray:
 
 basic_type_specifier_nonarray:
    VOID_TOK                 { $$ = glsl_type::void_type; }
-   | BASIC_TYPE_TOK         { $$ = $1; };
+   | BASIC_TYPE_TOK         { $$ = $1; }
+   | UNSIGNED BASIC_TYPE_TOK
+   {
+      if ($2 == glsl_type::int_type) {
+         $$ = glsl_type::uint_type;
+      } else {
+         _mesa_glsl_error(&@1, state,
+                          "\"unsigned\" is only allowed before \"int\"");
+      }
+   }
    ;
 
 precision_qualifier: