diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-05-03 11:26:27 +0200 |
---|---|---|
committer | Andres Gomez <agomez@igalia.com> | 2017-05-12 21:54:56 +0300 |
commit | 3dea3a38bd744ac3c9e0c77c2cad99112d96fda3 (patch) | |
tree | 78000a904f6deb0195df9781293c1a8092a2e071 | |
parent | f01462c08c3a482e0d1d03511aeccef9acb76df1 (diff) |
radeonsi: fix gl_PrimitiveID in tessellation with instanced draws on SI
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit f16b7558632d1d2d355a8251e969b8fc41f9c1e8)
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_draw.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index 51323686300..3aa2ecd7229 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -173,6 +173,20 @@ static void si_emit_derived_tess_state(struct si_context *sctx, if (sctx->b.chip_class == SI) { unsigned one_wave = 64 / MAX2(num_tcs_input_cp, num_tcs_output_cp); *num_patches = MIN2(*num_patches, one_wave); + + if (sctx->screen->b.info.max_se == 1) { + /* The VGT HS block increments the patch ID unconditionally + * within a single threadgroup. This results in incorrect + * patch IDs when instanced draws are used. + * + * The intended solution is to restrict threadgroups to + * a single instance by setting SWITCH_ON_EOI, which + * should cause IA to split instances up. However, this + * doesn't work correctly on SI when there is no other + * SE to switch to. + */ + *num_patches = 1; + } } sctx->last_num_patches = *num_patches; |