summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-12-26 21:16:28 -0500
committerMarge Bot <eric+marge@anholt.net>2021-01-18 01:17:19 +0000
commit6f74105a343d42bb6cb5a2ece7178a10d6117e8e (patch)
tree4913e6b5551412d8210bd5b991b59a8e0f93f48c
parentd0d4c4ba1d7a59f7fb9cf18c7fdf4546690f4387 (diff)
radeonsi: translate pipe_prim_type only when it changes
just sink it into the branch Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8548>
-rw-r--r--src/gallium/drivers/radeonsi/si_state_draw.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp
index 6aa448d157d..1ad1cf0e1d4 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp
@@ -781,7 +781,6 @@ static void si_emit_draw_registers(struct si_context *sctx, const struct pipe_dr
unsigned min_vertex_count)
{
struct radeon_cmdbuf *cs = &sctx->gfx_cs;
- unsigned vgt_prim = si_conv_pipe_prim(prim);
if (GFX_VERSION >= GFX10)
gfx10_emit_ge_cntl<GFX_VERSION, HAS_TESS, HAS_GS, NGG>(sctx, num_patches);
@@ -790,7 +789,9 @@ static void si_emit_draw_registers(struct si_context *sctx, const struct pipe_dr
(sctx, indirect, prim, num_patches, instance_count, primitive_restart,
min_vertex_count, info->vertices_per_patch);
- if (vgt_prim != sctx->last_prim) {
+ if (prim != sctx->last_prim) {
+ unsigned vgt_prim = si_conv_pipe_prim(prim);
+
if (GFX_VERSION >= GFX10)
radeon_set_uconfig_reg(cs, R_030908_VGT_PRIMITIVE_TYPE, vgt_prim);
else if (GFX_VERSION >= GFX7)
@@ -798,7 +799,7 @@ static void si_emit_draw_registers(struct si_context *sctx, const struct pipe_dr
else
radeon_set_config_reg(cs, R_008958_VGT_PRIMITIVE_TYPE, vgt_prim);
- sctx->last_prim = vgt_prim;
+ sctx->last_prim = prim;
}
/* Primitive restart. */