radeonsi: set prefer_mono outside of si_shader_selector_key

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12343>
This commit is contained in:
Marek Olšák 2021-08-11 12:41:52 -04:00 committed by Marge Bot
parent 5824ab569e
commit fb04378e76
2 changed files with 13 additions and 8 deletions

View file

@ -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);

View file

@ -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;