class ast_interface_block : public ast_node {
public:
- ast_interface_block(ast_type_qualifier layout,
- const char *instance_name,
+ ast_interface_block(const char *instance_name,
ast_array_specifier *array_specifier)
- : layout(layout), block_name(NULL), instance_name(instance_name),
+ : block_name(NULL), instance_name(instance_name),
array_specifier(array_specifier)
{
}
%token <identifier> IDENTIFIER TYPE_IDENTIFIER NEW_IDENTIFIER
%type <identifier> any_identifier
%type <interface_block> instance_name_opt
-%type <interface_block> buffer_instance_name_opt
%token <real> FLOATCONSTANT
%token <dreal> DOUBLECONSTANT
%token <n> INTCONSTANT UINTCONSTANT BOOLCONSTANT
%type <type_qualifier> subroutine_qualifier
%type <subroutine_list> subroutine_type_list
%type <type_qualifier> interface_qualifier
+%type <type_qualifier> uniform_interface_qualifier
%type <type_qualifier> buffer_interface_qualifier
%type <type_specifier> type_specifier
%type <type_specifier> type_specifier_nonarray
$$ = block;
}
- | buffer_interface_qualifier NEW_IDENTIFIER '{' member_list '}' buffer_instance_name_opt ';'
+ | uniform_interface_qualifier NEW_IDENTIFIER '{' member_list '}' instance_name_opt ';'
{
ast_interface_block *const block = $6;
+ block->layout = *state->default_uniform_qualifier;
+ block->block_name = $2;
+ block->declarations.push_degenerate_list_at_head(& $4->link);
+
+ _mesa_ast_process_interface_block(& @1, state, block, $1);
+
+ $$ = block;
+ }
+ | buffer_interface_qualifier NEW_IDENTIFIER '{' member_list '}' instance_name_opt ';'
+ {
+ ast_interface_block *const block = $6;
+
+ block->layout = *state->default_shader_storage_qualifier;
block->block_name = $2;
block->declarations.push_degenerate_list_at_head(& $4->link);
memset(& $$, 0, sizeof($$));
$$.flags.q.out = 1;
}
- | UNIFORM
+ ;
+
+uniform_interface_qualifier:
+ UNIFORM
{
memset(& $$, 0, sizeof($$));
$$.flags.q.uniform = 1;
instance_name_opt:
/* empty */
{
- $$ = new(state) ast_interface_block(*state->default_uniform_qualifier,
- NULL, NULL);
- }
- | NEW_IDENTIFIER
- {
- $$ = new(state) ast_interface_block(*state->default_uniform_qualifier,
- $1, NULL);
- $$->set_location(@1);
- }
- | NEW_IDENTIFIER array_specifier
- {
- $$ = new(state) ast_interface_block(*state->default_uniform_qualifier,
- $1, $2);
- $$->set_location_range(@1, @2);
- }
- ;
-
-buffer_instance_name_opt:
- /* empty */
- {
- $$ = new(state) ast_interface_block(*state->default_shader_storage_qualifier,
- NULL, NULL);
+ $$ = new(state) ast_interface_block(NULL, NULL);
}
| NEW_IDENTIFIER
{
- $$ = new(state) ast_interface_block(*state->default_shader_storage_qualifier,
- $1, NULL);
+ $$ = new(state) ast_interface_block($1, NULL);
$$->set_location(@1);
}
| NEW_IDENTIFIER array_specifier
{
- $$ = new(state) ast_interface_block(*state->default_shader_storage_qualifier,
- $1, $2);
+ $$ = new(state) ast_interface_block($1, $2);
$$->set_location_range(@1, @2);
}
;