diff options
author | Timothy Arceri <[email protected]> | 2016-01-18 16:09:06 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-01-20 08:06:35 +1100 |
commit | fd612e4547175d1350eac2d8374d01390de58acb (patch) | |
tree | 9a3381bd5b157002930b40abda9753e52cfd0404 /src/glsl | |
parent | c8b8c578d145f90794611602eb66fc7d3f1df033 (diff) |
glsl: split layout_defaults into specific types
This will allow merging of duplicate layout qualifiers as allowed
by ARB_shading_language_420pack
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/glsl_parser.yy | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index 51796a65df9..462ca45a55c 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -299,6 +299,10 @@ static bool match_layout_qualifier(const char *s1, const char *s2, %type <node> for_init_statement %type <for_rest_statement> for_rest_statement %type <node> layout_defaults +%type <node> layout_uniform_defaults +%type <node> layout_buffer_defaults +%type <node> layout_in_defaults +%type <node> layout_out_defaults %right THEN ELSE %% @@ -2737,7 +2741,7 @@ member_declaration: } ; -layout_defaults: +layout_uniform_defaults: layout_qualifier UNIFORM ';' { if (!state->default_uniform_qualifier->merge_qualifier(& @1, state, $1)) { @@ -2745,8 +2749,10 @@ layout_defaults: } $$ = NULL; } + ; - | layout_qualifier BUFFER ';' +layout_buffer_defaults: + layout_qualifier BUFFER ';' { if (!state->default_shader_storage_qualifier->merge_qualifier(& @1, state, $1)) { YYERROR; @@ -2764,16 +2770,20 @@ layout_defaults: $$ = NULL; } + ; - | layout_qualifier IN_TOK ';' +layout_in_defaults: + layout_qualifier IN_TOK ';' { $$ = NULL; if (!state->in_qualifier->merge_in_qualifier(& @1, state, $1, $$)) { YYERROR; } } + ; - | layout_qualifier OUT_TOK ';' +layout_out_defaults: + layout_qualifier OUT_TOK ';' { $$ = NULL; if (state->stage == MESA_SHADER_GEOMETRY) { @@ -2804,3 +2814,11 @@ layout_defaults: "tessellation control or geometry shaders"); } } + ; + +layout_defaults: + layout_uniform_defaults + | layout_buffer_defaults + | layout_in_defaults + | layout_out_defaults + ; |