From 07bd2cb23fab5f423cdab2b03607ef4798d0ceda Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 6 Sep 2020 00:55:57 -0400 Subject: [PATCH] radeonsi: deduplicate setting key.mono.u.vs_export_prim_id Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- 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: -- 2.30.2