diff options
author | Timothy Arceri <[email protected]> | 2016-01-22 12:45:10 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-03-31 12:50:00 +1100 |
commit | c9afd94af6fa129370eb001077724a77093ecd5a (patch) | |
tree | 98f994fe8134e0afdc61ac3eb5b302ae963ac1c0 /src/compiler/glsl/glsl_parser.yy | |
parent | 13f6c788ebc4f9969d2d12c1a8ba64fdcf5dc12e (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.yy')
-rw-r--r-- | src/compiler/glsl/glsl_parser.yy | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy index 5ed051a6705..1cecc09b8c8 100644 --- a/src/compiler/glsl/glsl_parser.yy +++ b/src/compiler/glsl/glsl_parser.yy @@ -1541,6 +1541,25 @@ layout_qualifier_id: } } + if (state->has_enhanced_layouts()) { + if (match_layout_qualifier("xfb_buffer", $1, state) == 0) { + $$.flags.q.xfb_buffer = 1; + $$.flags.q.explicit_xfb_buffer = 1; + $$.xfb_buffer = $3; + } + + if (match_layout_qualifier("xfb_offset", $1, state) == 0) { + $$.flags.q.explicit_xfb_offset = 1; + $$.offset = $3; + } + + if (match_layout_qualifier("xfb_stride", $1, state) == 0) { + $$.flags.q.xfb_stride = 1; + $$.flags.q.explicit_xfb_stride = 1; + $$.xfb_stride = $3; + } + } + static const char * const local_size_qualifiers[3] = { "local_size_x", "local_size_y", @@ -1915,6 +1934,12 @@ storage_qualifier: $$.flags.q.explicit_stream = 0; $$.stream = state->out_qualifier->stream; } + + if (state->has_enhanced_layouts()) { + $$.flags.q.xfb_buffer = 1; + $$.flags.q.explicit_xfb_buffer = 0; + $$.xfb_buffer = state->out_qualifier->xfb_buffer; + } } | UNIFORM { |