[Mesa-dev] [PATCH v5 60/70] glsl: Allow memory qualifiers on shader storage buffer blocks

Iago Toral Quiroga itoral at igalia.com
Thu Sep 10 06:36:16 PDT 2015


From: Samuel Iglesias Gonsalvez <siglesias at igalia.com>

v2:
  - Memory qualifiers on shader storage buffer objects do not come in the form
    of layout qualifiers, they are block-level qualifiers.
---
 src/glsl/glsl_parser.yy | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 4cb018a..f0abeb0 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -2628,6 +2628,20 @@ interface_block:
       }
       $$ = block;
    }
+   | memory_qualifier interface_block
+   {
+      ast_interface_block *block = (ast_interface_block *)$2;
+
+      if (!block->layout.flags.q.buffer) {
+            _mesa_glsl_error(& @1, state,
+                             "memory qualifiers can only be used in the "
+                             "declaration of shader storage blocks");
+      }
+      if (!block->layout.merge_qualifier(& @1, state, $1)) {
+         YYERROR;
+      }
+      $$ = block;
+   }
    ;
 
 basic_interface_block:
-- 
1.9.1



More information about the mesa-dev mailing list