From: Samuel Iglesias Gonsalvez Date: Fri, 8 May 2015 07:41:58 +0000 (+0200) Subject: glsl: Allow memory qualifiers on shader storage buffer blocks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ef82f039c6fc82dc0910e842a47c4a69ab44e12;p=mesa.git 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 --- 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: