Mesa (master): radeonsi: deduplicate setting key.mono.u.vs_export_prim_id

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 7 11:38:27 UTC 2020


Module: Mesa
Branch: master
Commit: 234505162c11ff52d775c536667ccbdd260bf6c1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=234505162c11ff52d775c536667ccbdd260bf6c1

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sun Sep  6 00:55:57 2020 -0400

radeonsi: deduplicate setting key.mono.u.vs_export_prim_id

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6620>

---

 src/gallium/drivers/radeonsi/si_state_shaders.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index ae430a3f504..df89c9dfe6b 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1786,6 +1786,9 @@ static void si_shader_selector_key_hw_vs(struct si_context *sctx, struct si_shad
 
    key->opt.kill_outputs = ~linked & outputs_written;
    key->opt.ngg_culling = sctx->ngg_culling;
+
+   if (sctx->ps_shader.cso && sctx->ps_shader.cso->info.uses_primid)
+      key->mono.u.vs_export_prim_id = 1;
 }
 
 /* Compute the key for the hw shader variant */
@@ -1809,9 +1812,6 @@ static inline void si_shader_selector_key(struct pipe_context *ctx, struct si_sh
       } else {
          key->as_ngg = stages_key.u.ngg;
          si_shader_selector_key_hw_vs(sctx, sel, key);
-
-         if (sctx->ps_shader.cso && sctx->ps_shader.cso->info.uses_primid)
-            key->mono.u.vs_export_prim_id = 1;
       }
       break;
    case MESA_SHADER_TESS_CTRL:
@@ -1850,9 +1850,6 @@ static inline void si_shader_selector_key(struct pipe_context *ctx, struct si_sh
          key->as_es = 1;
       else {
          si_shader_selector_key_hw_vs(sctx, sel, key);
-
-         if (sctx->ps_shader.cso && sctx->ps_shader.cso->info.uses_primid)
-            key->mono.u.vs_export_prim_id = 1;
       }
       break;
    case MESA_SHADER_GEOMETRY:



More information about the mesa-commit mailing list