lima: dont split vec3 unaligned load inputs
It seems that the mali400 pp is unable to load vec3 unaligned varyings.
This can happen in the current state with mesa if a varying float is put
into the first component of a vec4 and a vec3 is packed right after it.
This would be fine as by default nir would create a vec4 load followed
by a mov with swizzle to realign the components into a vec3.
In lima_nir_split_load_input, this becomes a separate vec3 load
expecting the unaligned load.
Since this can't happen, skip the load input splitting for this special
case.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6507>
diff --git a/src/gallium/drivers/lima/ir/lima_nir_split_load_input.c b/src/gallium/drivers/lima/ir/lima_nir_split_load_input.c
index 3c87a48..676189f 100644
--- a/src/gallium/drivers/lima/ir/lima_nir_split_load_input.c
+++ b/src/gallium/drivers/lima/ir/lima_nir_split_load_input.c
@@ -63,6 +63,10 @@
if (i != nir_dest_num_components(alu->dest.dest))
continue;
+ /* mali4xx can't access unaligned vec3, don't split load input */
+ if (nir_dest_num_components(alu->dest.dest) == 3 && swizzle > 0)
+ continue;
+
b->cursor = nir_before_instr(&intrin->instr);
nir_intrinsic_instr *new_intrin = nir_intrinsic_instr_create(
b->shader,