summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-12-02 21:20:49 +0100
committerNicolai Hähnle <[email protected]>2016-12-12 09:04:58 +0100
commitedf034ac142f2ae10befdf331b170373ff456495 (patch)
tree11a901ece23834edffbb22a57f51ecce33539068 /src/gallium/drivers
parentaf976f12a56d11face02fe74ef0f112ec26d4c69 (diff)
radeonsi: do not write non-existent components through the GSVS ring
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 441718bbee5..7324eb38a1c 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -5317,7 +5317,8 @@ 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)
+ if (!(info->output_usagemask[i] & (1 << chan)) ||
+ ((info->output_streams[i] >> (2 * chan)) & 3) != stream)
continue;
LLVMValueRef out_val = LLVMBuildLoad(gallivm->builder, out_ptr[chan], "");
@@ -6432,7 +6433,8 @@ si_generate_gs_copy_shader(struct si_screen *sscreen,
/* Fetch vertex data from GSVS ring */
for (i = 0; i < gsinfo->num_outputs; ++i) {
for (unsigned chan = 0; chan < 4; chan++) {
- if (outputs[i].vertex_stream[chan] != stream) {
+ if (!(gsinfo->output_usagemask[i] & (1 << chan)) ||
+ outputs[i].vertex_stream[chan] != stream) {
outputs[i].values[chan] = ctx.soa.bld_base.base.undef;
continue;
}