zink: unroll array loop when copying vars for passthrough shaders

wildcard derefs aren't supported in ntv

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22376>
This commit is contained in:
Mike Blumenkrantz 2023-04-07 15:22:54 -04:00 committed by Marge Bot
parent 26f767d524
commit 0c730f98c5

View file

@ -1139,7 +1139,10 @@ copy_vars(nir_builder *b, nir_deref_instr *dst, nir_deref_instr *src)
copy_vars(b, nir_build_deref_struct(b, dst, i), nir_build_deref_struct(b, src, i));
}
} else if (glsl_type_is_array_or_matrix(dst->type)) {
copy_vars(b, nir_build_deref_array_wildcard(b, dst), nir_build_deref_array_wildcard(b, src));
unsigned count = glsl_type_is_array(dst->type) ? glsl_array_size(dst->type) : glsl_get_matrix_columns(dst->type);
for (unsigned i = 0; i < count; i++) {
copy_vars(b, nir_build_deref_array_imm(b, dst, i), nir_build_deref_array_imm(b, src, i));
}
} else {
nir_ssa_def *load = nir_load_deref(b, src);
nir_store_deref(b, dst, load, BITFIELD_MASK(load->num_components));