Mesa (master): radeonsi: translate pipe_prim_type only when it changes
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jan 18 01:33:14 UTC 2021
Module: Mesa
Branch: master
Commit: 6f74105a343d42bb6cb5a2ece7178a10d6117e8e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f74105a343d42bb6cb5a2ece7178a10d6117e8e
Author: Marek Olšák <marek.olsak at amd.com>
Date: Sat Dec 26 21:16:28 2020 -0500
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 at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8548>
---
src/gallium/drivers/radeonsi/si_state_draw.cpp | 7 ++++---
1 file 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. */
More information about the mesa-commit
mailing list