[Mesa-dev,v2,08/23] glsl: Only geometry shader outputs can be associated with non-zero streams.

Submitted by Iago Toral Quiroga on June 18, 2014, 9:51 a.m.

Details

Message ID 1403085110-31168-9-git-send-email-itoral@igalia.com
State Accepted
Commit 598c2e2c83447cf222f96f833569eeb0bd179871
Headers show

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga June 18, 2014, 9:51 a.m.
This should be ensured by the parser, so assert on that.
---
 src/glsl/link_varyings.cpp | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 3d5a680..520a51a 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -1347,6 +1347,11 @@  assign_varying_locations(struct gl_context *ctx,
              (output_var->data.mode != ir_var_shader_out))
             continue;
 
+         /* Only geometry shaders can use non-zero streams */
+         assert(output_var->data.stream == 0 ||
+                (output_var->data.stream < MAX_VERTEX_STREAMS &&
+                 producer->Stage == MESA_SHADER_GEOMETRY));
+
          tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates);
          g.process(output_var);