glsl: add a parse check to check for the index layout qualifier
authorRyan Houdek <Sonicadvance1@gmail.com>
Thu, 5 Nov 2015 17:03:44 +0000 (11:03 -0600)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 19 Nov 2015 16:39:51 +0000 (11:39 -0500)
This can only be used if EXT_blend_func_extended is enabled

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/glsl/glsl_parser.yy

index adf6a05acce7c4e5cdda4a907dcef66eb283da55..403cbd1564aa4992a9e2d6d42752671fb0db24a2 100644 (file)
@@ -1476,6 +1476,11 @@ layout_qualifier_id:
       }
 
       if (match_layout_qualifier("index", $1, state) == 0) {
+         if (state->es_shader && !state->EXT_blend_func_extended_enable) {
+            _mesa_glsl_error(& @3, state, "index layout qualifier requires EXT_blend_func_extended");
+            YYERROR;
+         }
+
          $$.flags.q.explicit_index = 1;
 
          if ($3 >= 0) {