glsl: reset current stream tracker
authorTimothy Arceri <timothy.arceri@collabora.com>
Sun, 13 Mar 2016 05:36:25 +0000 (16:36 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Thu, 31 Mar 2016 01:52:17 +0000 (12:52 +1100)
When we move to the next buffer we need to reset the stream
so that we don't generate an error message about streams not
matching.

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/compiler/glsl/link_varyings.cpp

index 50c18d06ee8ea2198ac80cd765b772dbf60785f8..c5c392d6140b82f6302a8778d93aebf85aa080a5 100644 (file)
@@ -979,6 +979,12 @@ store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog,
       }
 
       for (unsigned i = 0; i < num_tfeedback_decls; ++i) {
+         if (has_xfb_qualifiers &&
+             buffer != tfeedback_decls[i].get_buffer()) {
+            /* we have moved to the next buffer so reset stream id */
+            buffer_stream_id = -1;
+         }
+
          if (tfeedback_decls[i].is_next_buffer_separator()) {
             num_buffers++;
             buffer_stream_id = -1;