glsl: remove duplicate validation for index layout qualifier
authorTimothy Arceri <timothy.arceri@collabora.com>
Fri, 13 Nov 2015 04:16:20 +0000 (15:16 +1100)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Fri, 20 Nov 2015 20:27:04 +0000 (07:27 +1100)
The minimum value for index is validated in apply_explicit_location()
and we want to remove validation from the parser so we can add
compile time constant support.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/glsl/glsl_parser.yy

index d2d5058befecbe8f20d1d3e167bf352576dffde4..a96b18087b8cba9715d5a2c7021fe80ac2e533f4 100644 (file)
@@ -1476,13 +1476,7 @@ layout_qualifier_id:
          }
 
          $$.flags.q.explicit_index = 1;
-
-         if ($3 >= 0) {
-            $$.index = $3;
-         } else {
-            _mesa_glsl_error(& @3, state, "invalid index %d specified", $3);
-            YYERROR;
-         }
+         $$.index = $3;
       }
 
       if ((state->has_420pack() ||