diff options
author | Jordan Justen <[email protected]> | 2013-03-09 14:52:14 -0800 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2013-05-23 09:37:11 -0700 |
commit | 9368604d996a4c6893f9ca84b1a0e863da9c91c0 (patch) | |
tree | 8197a4e5780cf118cc909ddb849d8c12a8f885e3 /src | |
parent | 067cc08d6ab41333cd0fa3ea49b9d0247631a28b (diff) |
glsl parser: allow in & out for interface block members
Previously uniform blocks allowed for the 'uniform' keyword
to be used with members of a uniform blocks. With interface
blocks 'in' can be used on 'in' interface block members and
'out' can be used on 'out' interface block members.
The basic_interface_block rule will verify that the same
qualifier type is used with the block and each member.
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/glsl_parser.yy | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index baac84568ca..6e92c26517b 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -2067,41 +2067,28 @@ member_list: } ; -/* Specifying "uniform" inside of a uniform block is redundant. */ -uniformopt: - /* nothing */ - | UNIFORM - ; - member_declaration: - layout_qualifier uniformopt type_specifier struct_declarator_list ';' + fully_specified_type struct_declarator_list ';' { void *ctx = state; - ast_fully_specified_type *type = new(ctx) ast_fully_specified_type(); + ast_fully_specified_type *type = $1; type->set_location(yylloc); - type->qualifier = $1; - type->qualifier.flags.q.uniform = true; - type->specifier = $3; - $$ = new(ctx) ast_declarator_list(type); - $$->set_location(yylloc); - $$->ubo_qualifiers_valid = true; - - $$->declarations.push_degenerate_list_at_head(& $4->link); - } - | uniformopt type_specifier struct_declarator_list ';' - { - void *ctx = state; - ast_fully_specified_type *type = new(ctx) ast_fully_specified_type(); - type->set_location(yylloc); + if (type->qualifier.flags.q.attribute) { + _mesa_glsl_error(& @1, state, + "keyword 'attribute' cannot be used with " + "interface block member\n"); + } else if (type->qualifier.flags.q.varying) { + _mesa_glsl_error(& @1, state, + "keyword 'varying' cannot be used with " + "interface block member\n"); + } - type->qualifier.flags.q.uniform = true; - type->specifier = $2; $$ = new(ctx) ast_declarator_list(type); $$->set_location(yylloc); $$->ubo_qualifiers_valid = true; - $$->declarations.push_degenerate_list_at_head(& $3->link); + $$->declarations.push_degenerate_list_at_head(& $2->link); } ; |