_mesa_glsl_parse_state *state,
ast_node* &node);
+ /**
+ * Push pending layout qualifiers to the global values.
+ */
+ bool push_to_global(YYLTYPE *loc,
+ _mesa_glsl_parse_state *state);
+
bool validate_flags(YYLTYPE *loc,
_mesa_glsl_parse_state *state,
const ast_type_qualifier &allowed_flags,
}
}
- if (q.flags.q.explicit_xfb_stride)
+ if (q.flags.q.explicit_xfb_stride) {
+ this->flags.q.xfb_stride = 1;
+ this->flags.q.explicit_xfb_stride = 1;
this->xfb_stride = q.xfb_stride;
-
- /* Merge all we xfb_stride qualifiers into the global out */
- if (q.flags.q.explicit_xfb_stride || this->flags.q.xfb_stride) {
-
- /* Set xfb_stride flag to 0 to avoid adding duplicates every time
- * there is a merge.
- */
- this->flags.q.xfb_stride = 0;
-
- unsigned buff_idx;
- if (process_qualifier_constant(state, loc, "xfb_buffer",
- this->xfb_buffer, &buff_idx)) {
- if (state->out_qualifier->out_xfb_stride[buff_idx]
- && !is_single_layout_merge && !is_multiple_layouts_merge) {
- state->out_qualifier->out_xfb_stride[buff_idx]->merge_qualifier(
- new(state->linalloc) ast_layout_expression(*loc, this->xfb_stride));
- } else {
- state->out_qualifier->out_xfb_stride[buff_idx] =
- new(state->linalloc) ast_layout_expression(*loc, this->xfb_stride);
- }
- }
}
}
return r;
}
+bool
+ast_type_qualifier::push_to_global(YYLTYPE *loc,
+ _mesa_glsl_parse_state *state)
+{
+ if (this->flags.q.xfb_stride) {
+ this->flags.q.xfb_stride = 0;
+
+ unsigned buff_idx;
+ if (process_qualifier_constant(state, loc, "xfb_buffer",
+ this->xfb_buffer, &buff_idx)) {
+ if (state->out_qualifier->out_xfb_stride[buff_idx]) {
+ state->out_qualifier->out_xfb_stride[buff_idx]->merge_qualifier(
+ new(state->linalloc) ast_layout_expression(*loc,
+ this->xfb_stride));
+ } else {
+ state->out_qualifier->out_xfb_stride[buff_idx] =
+ new(state->linalloc) ast_layout_expression(*loc,
+ this->xfb_stride);
+ }
+ }
+ }
+
+ return true;
+}
+
/**
* Check if the current type qualifier has any illegal flags.
*
}
}
block->layout = block->default_layout;
-
+ if (!block->layout.push_to_global(& @1, state)) {
+ YYERROR;
+ }
$$ = $1;
}
;
{
$$ = $2;
$$->type->qualifier = $1;
+ if (!$$->type->qualifier.push_to_global(& @1, state)) {
+ YYERROR;
+ }
}
| parameter_qualifier parameter_type_specifier
{
$$->type = new(ctx) ast_fully_specified_type();
$$->type->set_location_range(@1, @2);
$$->type->qualifier = $1;
+ if (!$$->type->qualifier.push_to_global(& @1, state)) {
+ YYERROR;
+ }
$$->type->specifier = $2;
}
;
$$ = new(ctx) ast_fully_specified_type();
$$->set_location_range(@1, @2);
$$->qualifier = $1;
+ if (!$$->qualifier.push_to_global(& @1, state)) {
+ YYERROR;
+ }
$$->specifier = $2;
if ($$->specifier->structure != NULL &&
$$->specifier->structure->is_declaration) {
merge_qualifier(& @1, state, $1, false)) {
YYERROR;
}
+ if (!state->default_uniform_qualifier->
+ push_to_global(& @1, state)) {
+ YYERROR;
+ }
}
| layout_buffer_defaults
{
merge_qualifier(& @1, state, $1, false)) {
YYERROR;
}
+ if (!state->default_shader_storage_qualifier->
+ push_to_global(& @1, state)) {
+ YYERROR;
+ }
/* From the GLSL 4.50 spec, section 4.4.5:
*
if (!$1.merge_into_in_qualifier(& @1, state, $$)) {
YYERROR;
}
+ if (!state->in_qualifier->push_to_global(& @1, state)) {
+ YYERROR;
+ }
}
| layout_out_defaults
{
if (!$1.merge_into_out_qualifier(& @1, state, $$)) {
YYERROR;
}
+ if (!state->out_qualifier->push_to_global(& @1, state)) {
+ YYERROR;
+ }
}
;