diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index d16cba67368..a2e8dfc2767 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -717,6 +717,18 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign si_init_cp_reg_shadowing(sctx); } + /* Set immutable fields of shader keys. */ + if (sctx->chip_class >= GFX9) { + /* The LS output / HS input layout can be communicated + * directly instead of via user SGPRs for merged LS-HS. + * This also enables jumping over the VS prolog for HS-only waves. + */ + sctx->shader.tcs.key.opt.prefer_mono = 1; + + /* This enables jumping over the VS prolog for GS-only waves. */ + sctx->shader.gs.key.opt.prefer_mono = 1; + } + si_begin_new_gfx_cs(sctx, true); assert(sctx->gfx_cs.current.cdw == sctx->initial_gfx_cs_size); diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 02fc51b5b59..5bcef1376d9 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -1819,6 +1819,7 @@ void si_vs_key_update_inputs(struct si_context *sctx) key->part.vs.prolog.instance_divisor_is_one = elts->instance_divisor_is_one; key->part.vs.prolog.instance_divisor_is_fetched = elts->instance_divisor_is_fetched; + key->opt.prefer_mono = elts->instance_divisor_is_fetched; unsigned count_mask = (1 << vs->info.num_inputs) - 1; unsigned fix = elts->fix_fetch_always & count_mask; @@ -2157,11 +2158,6 @@ static inline void si_shader_selector_key(struct pipe_context *ctx, struct si_sh */ key->part.tcs.ls_prolog.ls_vgpr_fix = sctx->ls_vgpr_fix; - /* The LS output / HS input layout can be communicated - * directly instead of via user SGPRs for merged LS-HS. - * This also enables jumping over the VS prolog for HS-only waves. - */ - key->opt.prefer_mono = 1; key->opt.same_patch_vertices = sctx->same_patch_vertices; } @@ -2195,9 +2191,6 @@ static inline void si_shader_selector_key(struct pipe_context *ctx, struct si_sh si_get_vs_key_outputs(sctx, sel, key); else si_clear_vs_key_outputs(sctx, sel, key); - - /* This enables jumping over the VS prolog for GS-only waves. */ - key->opt.prefer_mono = 1; } key->part.gs.prolog.tri_strip_adj_fix = sctx->gs_tri_strip_adj_fix; break;