glsl: add `unsigned int` type for EXT_GPU_shader4
[mesa.git] / src / compiler / glsl / glsl_parser.yy
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: