aco/gfx12: disable vinterp ddx/ddy optimization

This only seems to work on gfx11 and gfx11.5, and it's only faster on gfx11.5.

We could continue to use vinterp, with constants copied to vgprs, but
whether that's beneficial depends on the shader.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>

Fixes: bee487df48 ("aco/gfx11.5+: use vinterp for fddx/fddy")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12250
(cherry picked from commit 7425e71ae0)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32730>
This commit is contained in:
Georg Lehmann
2024-12-05 08:40:40 +01:00
committed by Dylan Baker
parent 10f599a8b3
commit f750108aa9
2 changed files with 6 additions and 2 deletions

View File

@@ -234,7 +234,7 @@
"description": "aco/gfx12: disable vinterp ddx/ddy optimization",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "bee487df48b19fc3bf792874aa6aff25104e281a",
"notes": null

View File

@@ -8603,8 +8603,12 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
} else {
aco_opcode subrev =
instr->def.bit_size == 16 ? aco_opcode::v_subrev_f16 : aco_opcode::v_subrev_f32;
/* v_interp with constant sources only works on GFX11/11.5,
* and it's only faster on GFX11.5.
*/
bool use_interp = dpp_ctrl1 == dpp_quad_perm(0, 0, 0, 0) && instr->def.bit_size == 32 &&
ctx->program->gfx_level >= GFX11_5;
ctx->program->gfx_level == GFX11_5;
if (!nir_src_is_divergent(&instr->src[0])) {
bld.vop2(subrev, Definition(dst), src, src);
} else if (use_interp && dpp_ctrl2 == dpp_quad_perm(1, 1, 1, 1)) {