radeonsi/gfx10: take PRIMID from the correct output when exported by GS
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 1 Jun 2018 14:03:31 +0000 (16:03 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Jul 2019 19:51:12 +0000 (15:51 -0400)
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 442cbca3fe6cd024bc97722b18aa69034399b468..80d06b198677cd91264c03a11e1d04f3aec47b41 100644 (file)
@@ -3156,8 +3156,8 @@ static unsigned si_get_ps_input_cntl(struct si_context *sctx,
                }
        }
 
-       if (name == TGSI_SEMANTIC_PRIMID)
-               /* PrimID is written after the last output. */
+       if (j == vsinfo->num_outputs && name == TGSI_SEMANTIC_PRIMID)
+               /* PrimID is written after the last output when HW VS is used. */
                ps_input_cntl |= S_028644_OFFSET(vs->info.vs_output_param_offset[vsinfo->num_outputs]);
        else if (j == vsinfo->num_outputs && !G_028644_PT_SPRITE_TEX(ps_input_cntl)) {
                /* No corresponding output found, load defaults into input.