summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glsl_parser_extras.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-01-22 12:45:10 +1100
committerTimothy Arceri <[email protected]>2016-03-31 12:50:00 +1100
commitc9afd94af6fa129370eb001077724a77093ecd5a (patch)
tree98f994fe8134e0afdc61ac3eb5b302ae963ac1c0 /src/compiler/glsl/glsl_parser_extras.cpp
parent13f6c788ebc4f9969d2d12c1a8ba64fdcf5dc12e (diff)
glsl: parse new transform feedback layout qualifiers
We reuse the existing offset field for holding the xfb_offset expression but create a new flag as to avoid hitting the rules for the offset qualifier for UBOs. xfb_buffer qualifiers require extra processing when merging as they can be applied to global out defaults. We just apply the same rules as we do for the stream qualifier as the spec says: "The *xfb_buffer* qualifier follows the same conventions, behavior, defaults, and inheritance rules as the qualifier stream, and the examples for stream apply here as well." For xfb_stride we push everything into a global out field for later processing as xfb_stride applies to the entire buffer. We still need to have a separate field to store per variable strides because they can still effect implicit offsets e.g. when applied to block members with implicit offsets. Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glsl_parser_extras.cpp')
-rw-r--r--src/compiler/glsl/glsl_parser_extras.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index a8fa75395e0..76ae0f88167 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -939,6 +939,13 @@ _mesa_ast_process_interface_block(YYLTYPE *locp,
block->layout.stream = state->out_qualifier->stream;
}
+ if (state->has_enhanced_layouts() && block->layout.flags.q.out) {
+ /* Assign global layout's xfb_buffer value. */
+ block->layout.flags.q.xfb_buffer = 1;
+ block->layout.flags.q.explicit_xfb_buffer = 0;
+ block->layout.xfb_buffer = state->out_qualifier->xfb_buffer;
+ }
+
foreach_list_typed (ast_declarator_list, member, link, &block->declarations) {
ast_type_qualifier& qualifier = member->type->qualifier;
if ((qualifier.flags.i & interface_type_mask) == 0) {