aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsalvez <[email protected]>2015-05-08 09:41:58 +0200
committerSamuel Iglesias Gonsalvez <[email protected]>2015-09-25 08:39:23 +0200
commit6ef82f039c6fc82dc0910e842a47c4a69ab44e12 (patch)
treebacd76c1b715c59be6a4596ab3ccb6b5d636edb3 /src/glsl
parentf1b647fdd1028bf475ed258c4dd8b833339ec796 (diff)
glsl: Allow memory qualifiers on shader storage buffer blocks
v2: - Memory qualifiers on shader storage buffer objects do not come in the form of layout qualifiers, they are block-level qualifiers. Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/glsl_parser.yy14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 4cb018a5862..f0abeb03215 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: