radv: don't use radv_optimize_nir after lowering indirect derefs for RT
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Just these three passes seem necessary. radv_rt_nir_to_asm() will call
radv_optimize_nir() later.

fossil-db (navi21):
Totals from 32 (0.02% of 202427) affected shaders:
Instrs: 205974 -> 205948 (-0.01%)
CodeSize: 1131492 -> 1131352 (-0.01%)
SpillSGPRs: 321 -> 320 (-0.31%)
Latency: 2171106 -> 2170677 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 540282 -> 540174 (-0.02%)
VClause: 5579 -> 5578 (-0.02%)
SClause: 4586 -> 4582 (-0.09%)
Copies: 23543 -> 23535 (-0.03%)
PreSGPRs: 2444 -> 2443 (-0.04%)
VALU: 129415 -> 129399 (-0.01%)
SMEM: 7175 -> 7170 (-0.07%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31265>
This commit is contained in:
Rhys Perry 2026-03-06 15:23:02 +00:00 committed by Marge Bot
parent 91d555c2cb
commit f9f60aa844

View file

@ -657,11 +657,9 @@ radv_rt_spirv_to_nir(const struct radv_compiler_info *compiler_info, struct radv
{
stage->nir = radv_shader_spirv_to_nir(compiler_info, stage, NULL, false);
bool indirect_derefs_lowered = false;
NIR_PASS(indirect_derefs_lowered, stage->nir, ac_nir_lower_indirect_derefs);
NIR_PASS(_, stage->nir, ac_nir_lower_indirect_derefs);
NIR_PASS(_, stage->nir, nir_lower_vars_to_ssa);
if (indirect_derefs_lowered && !stage->key.optimisations_disabled)
radv_optimize_nir(stage->nir, false);
NIR_PASS(_, stage->nir, nir_remove_dead_variables, nir_var_function_temp, NULL);
nir_foreach_variable_with_modes (var, stage->nir, nir_var_ray_hit_attrib) {
unsigned size, alignment;