radeonsi: only write values belonging to the stream when emitting GS vertex
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 29 Nov 2016 15:27:10 +0000 (16:27 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 12 Dec 2016 08:04:54 +0000 (09:04 +0100)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index 469e0c1cc3df1a864c30de98d748646bacde6c8b..441718bbee56e14c4b195b255e6f0bb53b45dadb 100644 (file)
@@ -5317,6 +5317,9 @@ static void si_llvm_emit_vertex(
                        ctx->soa.outputs[i];
 
                for (chan = 0; chan < 4; chan++) {
+                       if (((info->output_streams[i] >> (2 * chan)) & 3) != stream)
+                               continue;
+
                        LLVMValueRef out_val = LLVMBuildLoad(gallivm->builder, out_ptr[chan], "");
                        LLVMValueRef voffset =
                                lp_build_const_int32(gallivm, (i * 4 + chan) *