pco: support shader i/o arrays of structs

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
Simon Perretta 2025-02-22 15:59:44 +00:00 committed by Marge Bot
parent d038d9181c
commit 195cb4bfce

View file

@ -701,10 +701,15 @@ void pco_lower_nir(pco_ctx *ctx, nir_shader *nir, pco_data *data)
NIR_PASS(_, nir, pco_nir_lower_io);
NIR_PASS(_, nir, pco_nir_lower_atomics, &uses_usclib);
NIR_PASS(_, nir, nir_opt_constant_folding);
if (nir->info.stage == MESA_SHADER_VERTEX) {
/* TODO: false? */
NIR_PASS(_, nir, nir_lower_io_array_vars_to_elements_no_indirects, true);
NIR_PASS(_, nir, nir_split_struct_vars, nir_var_shader_out);
NIR_PASS(_, nir, nir_split_struct_vars, nir_var_shader_in);
} else if (nir->info.stage == MESA_SHADER_FRAGMENT) {
NIR_PASS(_, nir, nir_lower_io_array_vars_to_elements_no_indirects, false);
NIR_PASS(_, nir, nir_split_struct_vars, nir_var_shader_in);
}