From 1fe7bbb911ac708999685c942e971693b688a334 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 31 May 2016 12:51:47 +1000 Subject: glsl/linker: fix multiple streams transform feedback. e2791b38b42f83add5b07298c39741bf0a6d7d4b mesa/program_interface_query: fix transform feedback varyings. caused a regression in GL45-CTS.gtf40.GL3Tests.transform_feedback3.transform_feedback3_multiple_streams on radeonsi. The problem was it was using the skip components varying to set the stream id, when it should wait until a varying was written, this just adds the varying checks in the right place. Cc: "12.0" Reviewed-by: Timothy Arceri Signed-off-by: Dave Airlie --- src/compiler/glsl/link_varyings.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp index 7c3bedf3574..a286e773b30 100644 --- a/src/compiler/glsl/link_varyings.cpp +++ b/src/compiler/glsl/link_varyings.cpp @@ -1117,21 +1117,23 @@ store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog, num_buffers++; buffer_stream_id = -1; continue; - } else if (buffer_stream_id == -1) { - /* First varying writing to this buffer: remember its stream */ - buffer_stream_id = (int) tfeedback_decls[i].get_stream_id(); - } else if (buffer_stream_id != - (int) tfeedback_decls[i].get_stream_id()) { - /* Varying writes to the same buffer from a different stream */ - linker_error(prog, - "Transform feedback can't capture varyings belonging " - "to different vertex streams in a single buffer. " - "Varying %s writes to buffer from stream %u, other " - "varyings in the same buffer write from stream %u.", - tfeedback_decls[i].name(), - tfeedback_decls[i].get_stream_id(), - buffer_stream_id); - return false; + } else if (tfeedback_decls[i].is_varying()) { + if (buffer_stream_id == -1) { + /* First varying writing to this buffer: remember its stream */ + buffer_stream_id = (int) tfeedback_decls[i].get_stream_id(); + } else if (buffer_stream_id != + (int) tfeedback_decls[i].get_stream_id()) { + /* Varying writes to the same buffer from a different stream */ + linker_error(prog, + "Transform feedback can't capture varyings belonging " + "to different vertex streams in a single buffer. " + "Varying %s writes to buffer from stream %u, other " + "varyings in the same buffer write from stream %u.", + tfeedback_decls[i].name(), + tfeedback_decls[i].get_stream_id(), + buffer_stream_id); + return false; + } } if (has_xfb_qualifiers) { -- cgit v1.2.3