From 6a660a5f5dad02a6594ea905c511ba3cae6862a5 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Fri, 15 Jan 2016 12:43:10 +1100 Subject: glsl: allow multiple layout qualifiers for a single declaration From the ARB_shading_language_420pack spec: "More than one layout qualifier may appear in a single declaration. If the same layout-qualifier-name occurs in multiple layout qualifiers for the same declaration, the last one overrides the former ones." The parser was already failing correctly when the extension is not available but testing for duplicates within a single layout qualifier was still causing this to fail when available as both cases share the same function for merging. Here we add a parameter to differentiate between the two uses and apply it to the duplicate test. Acked-by: Matt Turner Reviewed-by: Chris Forbes --- src/glsl/ast.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/glsl/ast.h') diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 465166994ea..03df6c08b2b 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -699,7 +699,8 @@ struct ast_type_qualifier { bool merge_qualifier(YYLTYPE *loc, _mesa_glsl_parse_state *state, - const ast_type_qualifier &q); + const ast_type_qualifier &q, + bool is_single_layout_merge); bool merge_out_qualifier(YYLTYPE *loc, _mesa_glsl_parse_state *state, -- cgit v1.2.3