glsl: layout qualifier can appear more than once since OpenGL 4.20
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Wed, 2 Sep 2015 13:58:01 +0000 (15:58 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Fri, 25 Sep 2015 06:39:21 +0000 (08:39 +0200)
Also if GL_ARB_shading_language_420pack extension is enabled.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/glsl/glsl_parser.yy

index 59e4527b23811ac801e2297725aa166c320e6279..4dd5384dac82ba256ecc9dc9e4c7f0079f567f5d 100644 (file)
@@ -2595,9 +2595,15 @@ interface_block:
    {
       $$ = $1;
    }
-   | layout_qualifier basic_interface_block
+   | layout_qualifier interface_block
    {
-      ast_interface_block *block = $2;
+      ast_interface_block *block = (ast_interface_block *) $2;
+
+      if (!state->has_420pack() && block->layout.has_layout()) {
+         _mesa_glsl_error(&@1, state, "duplicate layout(...) qualifiers");
+         YYERROR;
+      }
+
       if (!block->layout.merge_qualifier(& @1, state, $1)) {
          YYERROR;
       }