radv: improve lower_array_layer_round_even condition
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

If conformant_trunc_coord=true, then the hardware never truncates the
layer and this lowering isn't needed.

If conformant_trunc_coord=false, then this lowering is needed if
TRUNC_COORD might be set, which is never the case if
disable_trunc_coord=true.

The previous version of this code always did the lowering if
disable_trunc_coord=true, which shouldn't be necessary.

fossil-db (navi31):
Totals from 2244 (2.00% of 112041) affected shaders:
MaxWaves: 50550 -> 50552 (+0.00%)
Instrs: 4497677 -> 4495106 (-0.06%); split: -0.07%, +0.01%
CodeSize: 23967696 -> 23958808 (-0.04%); split: -0.05%, +0.01%
VGPRs: 165132 -> 165096 (-0.02%)
Latency: 45174171 -> 45165056 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 7645548 -> 7639935 (-0.07%); split: -0.08%, +0.00%
VClause: 66733 -> 66717 (-0.02%); split: -0.08%, +0.05%
SClause: 83906 -> 83936 (+0.04%); split: -0.08%, +0.12%
Copies: 297125 -> 297292 (+0.06%); split: -0.19%, +0.24%
Branches: 69963 -> 69960 (-0.00%)
PreSGPRs: 142985 -> 143002 (+0.01%)
PreVGPRs: 138017 -> 137966 (-0.04%)
VALU: 3022018 -> 3019855 (-0.07%); split: -0.07%, +0.00%
SALU: 389844 -> 389663 (-0.05%); split: -0.12%, +0.07%
VOPD: 809 -> 810 (+0.12%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40409>
This commit is contained in:
Rhys Perry 2026-03-13 16:02:16 +00:00 committed by Marge Bot
parent f1db717ff6
commit 200555fd3b

View file

@ -340,7 +340,7 @@ radv_postprocess_nir(struct radv_device *device, const struct radv_graphics_stat
&(ac_nir_lower_image_tex_options){
.gfx_level = gfx_level,
.lower_array_layer_round_even =
!pdev->info.compiler_info.conformant_trunc_coord || pdev->cache_key.disable_trunc_coord,
!pdev->info.compiler_info.conformant_trunc_coord && !pdev->cache_key.disable_trunc_coord,
.fix_derivs_in_divergent_cf = stage->stage == MESA_SHADER_FRAGMENT && !use_llvm,
.max_wqm_vgprs = 64, // TODO: improve spiller and RA support for linear VGPRs
});