radeonsi: add shader profiles that disable binning

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13966>
This commit is contained in:
Marek Olšák 2021-11-27 11:39:23 -05:00 committed by Marge Bot
parent 4fd8171f64
commit af9ec3c45d
5 changed files with 34 additions and 1 deletions

View File

@ -1182,6 +1182,8 @@ struct si_context {
bool need_check_render_feedback;
bool decompression_enabled;
bool dpbb_force_off;
bool dpbb_force_off_profile_vs;
bool dpbb_force_off_profile_ps;
bool vs_writes_viewport_index;
bool vs_disables_clipping_viewport;

View File

@ -291,6 +291,8 @@ enum
#define SI_PROFILE_WAVE32 (1 << 0)
#define SI_PROFILE_WAVE64 (1 << 1)
#define SI_PROFILE_IGNORE_LLVM_DISCARD_BUG (1 << 2)
#define SI_PROFILE_VS_NO_BINNING (1 << 3)
#define SI_PROFILE_PS_NO_BINNING (1 << 4)
/**
* For VS shader keys, describe any fixups required for vertex fetch.

View File

@ -41,11 +41,21 @@ struct si_shader_profile {
static struct si_shader_profile profiles[] =
{
{
/* Plot3D */
{0x485320cd, 0x87a9ba05, 0x24a60e4f, 0x25aa19f7, 0xf5287451},
SI_PROFILE_VS_NO_BINNING,
},
{
/* Viewperf/Energy isn't affected by the discard bug. */
{0x17118671, 0xd0102e0c, 0x947f3592, 0xb2057e7b, 0x4da5d9b0},
SI_PROFILE_IGNORE_LLVM_DISCARD_BUG,
},
{
/* Viewperf/Medical */
{0x4dce4331, 0x38f778d5, 0x1b75a717, 0x3e454fb9, 0xeb1527f0},
SI_PROFILE_PS_NO_BINNING,
},
{
/* Viewperf/Medical, a shader with a divergent loop doesn't benefit from Wave32,
* probably due to interpolation performance.

View File

@ -449,7 +449,8 @@ void si_emit_dpbb_state(struct si_context *sctx)
assert(sctx->chip_class >= GFX9);
if (!sscreen->dpbb_allowed || sctx->dpbb_force_off) {
if (!sscreen->dpbb_allowed || sctx->dpbb_force_off ||
sctx->dpbb_force_off_profile_vs || sctx->dpbb_force_off_profile_ps) {
si_emit_dpbb_disable(sctx);
return;
}

View File

@ -3336,6 +3336,15 @@ static void si_bind_vs_shader(struct pipe_context *ctx, void *state)
si_get_vs(sctx)->current);
si_update_rasterized_prim(sctx);
si_vs_key_update_inputs(sctx);
if (sctx->screen->dpbb_allowed) {
bool force_off = sel && sel->info.options & SI_PROFILE_VS_NO_BINNING;
if (force_off != sctx->dpbb_force_off_profile_vs) {
sctx->dpbb_force_off_profile_vs = force_off;
si_mark_atom_dirty(sctx, &sctx->atoms.s.dpbb_state);
}
}
}
static void si_update_tess_uses_prim_id(struct si_context *sctx)
@ -3555,6 +3564,15 @@ static void si_bind_ps_shader(struct pipe_context *ctx, void *state)
si_update_ps_inputs_read_or_disabled(sctx);
si_update_ps_kill_enable(sctx);
si_update_vrs_flat_shading(sctx);
if (sctx->screen->dpbb_allowed) {
bool force_off = sel && sel->info.options & SI_PROFILE_PS_NO_BINNING;
if (force_off != sctx->dpbb_force_off_profile_ps) {
sctx->dpbb_force_off_profile_ps = force_off;
si_mark_atom_dirty(sctx, &sctx->atoms.s.dpbb_state);
}
}
}
static void si_delete_shader(struct si_context *sctx, struct si_shader *shader)