nir/unlower_io_to_vars: keep io bases intact when keeping intrinsics
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

nir_recompute_io_bases will modify i/o intrinsics, which is not the
expected behaviour when the keep_intrinsics flag is set.

Fixes: 83aecc8f3f ("mesa/st, nir: commonize unlower_io_to_vars pass")
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37725>
This commit is contained in:
Simon Perretta 2025-09-29 15:38:45 +01:00
parent dd9e002129
commit 79923115e7

View file

@ -708,7 +708,10 @@ nir_unlower_io_to_vars(nir_shader *nir, bool keep_intrinsics)
nir_variable_mode modes =
nir_var_shader_out |
(nir->info.stage != MESA_SHADER_VERTEX ? nir_var_shader_in : 0);
bool progress = nir_recompute_io_bases(nir, modes);
bool progress = false;
if (!keep_intrinsics)
progress = nir_recompute_io_bases(nir, modes);
/* Gather component masks. */
uint8_t component_masks[NUM_TOTAL_VARYING_SLOTS * 2] = {0};