summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2016-03-14 11:16:55 +1100
committerTimothy Arceri <timothy.arceri@collabora.com>2016-03-31 12:52:34 +1100
commitb77c9098782a36cb811891b2bcb572eb61e608ac (patch)
treec2a222c7099a542d46ffe91e8acfb5a5a47e192f /src/compiler/glsl/link_varyings.cpp
parentc95e92b14d69c114b79d941c7e8902a0ea62c287 (diff)
downloadexternal_mesa3d-b77c9098782a36cb811891b2bcb572eb61e608ac.zip
external_mesa3d-b77c9098782a36cb811891b2bcb572eb61e608ac.tar.gz
external_mesa3d-b77c9098782a36cb811891b2bcb572eb61e608ac.tar.bz2
glsl: always enable transform feedback mode when xfb_stride defined
This enables in shader defined transform feedback mode even if the only place xfb_stride is defined is on the global out. We don't worry about xfb_buffer since Issue 22 c) in the spec says: "If the shader has an "xfb_buffer" qualifier identifying a buffer, but doesn't declare "xfb_offset" on anything associated with it, what happens? ... variables not qualified with "xfb_offset" are not captured, which makes the associated "xfb_buffer" qualifier irrelevant." Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/compiler/glsl/link_varyings.cpp')
-rw-r--r--src/compiler/glsl/link_varyings.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index ce6ff08..d486b69 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -113,6 +113,16 @@ process_xfb_layout_qualifiers(void *mem_ctx, const gl_shader *sh,
{
bool has_xfb_qualifiers = false;
+ /* We still need to enable transform feedback mode even if xfb_stride is
+ * only applied to a global out. Also we don't bother to propagate
+ * xfb_stride to interface block members so this will catch that case also.
+ */
+ for (unsigned j = 0; j < MAX_FEEDBACK_BUFFERS; j++) {
+ if (sh->TransformFeedback.BufferStride[j]) {
+ has_xfb_qualifiers = true;
+ }
+ }
+
foreach_in_list(ir_instruction, node, sh->ir) {
ir_variable *var = node->as_variable();
if (!var || var->data.mode != ir_var_shader_out)