mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-08 11:30:06 +00:00
adba7dfc68
If a block has assigned a XfbOffset it is assumed that it would inherit the current global XfbBuffer. This commit fixes two use cases: 1) Getting the members of a Block with a XfbOffset to be assigned an offset, as explained on GLSL 4.60 spec, section "4.4.2 Output Layout Qualifiers", subsection "Transform Feedback Layout Qualifiers". 2) Compute properly an error on overlapping ranges if a block is assigned a XfbOffset and one of it members is assigned a explicit one. This gets working because when the members of a block get assigned a Offset/Buffer at fixBlockXfbOffsets, then the block is deassigned the Offsets, so ranges are computed only with the block members. BTW, this is already done when redeclaring block builtins. Fixes #1535
20 lines
549 B
GLSL
20 lines
549 B
GLSL
#version 450
|
|
|
|
/* block definition from GLSL spec 4.60, section 4.4.2, Output Layout Qualifiers */
|
|
|
|
layout(location=5, xfb_buffer = 3, xfb_offset = 12) out block2 {
|
|
vec4 v; // v will be written to byte offsets 12 through 27 of buffer
|
|
float u; // u will be written to offset 28
|
|
layout(xfb_offset = 40) vec4 w;
|
|
vec4 x; // x will be written to offset 56, the next available offset
|
|
};
|
|
|
|
void main() {
|
|
v = vec4(1.0, 0.0, 1.0, 0.0);
|
|
u = 5.0;
|
|
w = vec4(1.0, 0.0, 0.0, 1.0);
|
|
x = vec4(5.0, 0.0, 0.0, 0.0);
|
|
|
|
gl_Position = vec4(0.0);
|
|
}
|