summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state_draw.c
diff options
context:
space:
mode:
authorJames Legg <jlegg@feralinteractive.com>2016-10-04 14:30:11 +0100
committerMarek Olšák <marek.olsak@amd.com>2016-10-04 15:57:37 +0200
commite33f31d61f5e9019f8b0bac0378dfb8fd1147421 (patch)
tree8ff577d346d838a4715ab4de88bea9c83867f459 /src/gallium/drivers/radeonsi/si_state_draw.c
parent338d3c0b0f9c56e68c31ff542513fb7fa9f1c099 (diff)
downloadexternal_mesa3d-e33f31d61f5e9019f8b0bac0378dfb8fd1147421.zip
external_mesa3d-e33f31d61f5e9019f8b0bac0378dfb8fd1147421.tar.gz
external_mesa3d-e33f31d61f5e9019f8b0bac0378dfb8fd1147421.tar.bz2
radeonsi: Fix primitive restart when index changes
If primitive restart is enabled for two consecutive draws which use different primitive restart indices, then the first draw's primitive restart index was incorrectly used for the second draw. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98025 Cc: 11.1 11.2 12.0 <mesa-stable@lists.freedesktop.org> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state_draw.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_draw.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index e44147f..10e8be4 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -509,13 +509,13 @@ static void si_emit_draw_registers(struct si_context *sctx,
radeon_set_context_reg(cs, R_028A94_VGT_MULTI_PRIM_IB_RESET_EN, info->primitive_restart);
sctx->last_primitive_restart_en = info->primitive_restart;
- if (info->primitive_restart &&
- (info->restart_index != sctx->last_restart_index ||
- sctx->last_restart_index == SI_RESTART_INDEX_UNKNOWN)) {
- radeon_set_context_reg(cs, R_02840C_VGT_MULTI_PRIM_IB_RESET_INDX,
- info->restart_index);
- sctx->last_restart_index = info->restart_index;
- }
+ }
+ if (info->primitive_restart &&
+ (info->restart_index != sctx->last_restart_index ||
+ sctx->last_restart_index == SI_RESTART_INDEX_UNKNOWN)) {
+ radeon_set_context_reg(cs, R_02840C_VGT_MULTI_PRIM_IB_RESET_INDX,
+ info->restart_index);
+ sctx->last_restart_index = info->restart_index;
}
}