panfrost: Constant-fold io locations after lowering

This makes panfrost IO lowering similar to panvk and avoids subtle
bugs later in the series.

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40924>
This commit is contained in:
Lorenzo Rossi 2026-04-15 11:04:04 +02:00 committed by Marge Bot
parent 63aceb07ff
commit cf6ce1bb8c

View file

@ -543,6 +543,12 @@ panfrost_create_shader_state(struct pipe_context *pctx,
nir_var_shader_in | nir_var_shader_out, UINT32_MAX);
NIR_PASS(_, nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
glsl_type_size, nir_lower_io_use_interpolated_input_intrinsics);
/* nir_lower_io just computes offsets based on the original deref and
* lower_indirect_derefs ensures that the array derefs have a constant
* index. Constant-fold to get us actual constants in in load/store
* instructions.
*/
NIR_PASS(_, nir, nir_opt_constant_folding);
if (nir->info.stage == MESA_SHADER_FRAGMENT)
so->noperspective_varyings =