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>
This commit is contained in:
Erico Nunes 2020-08-30 22:12:23 +02:00 committed by Marge Bot
parent bea6290ca0
commit 4868ce1451

View file

@ -63,6 +63,10 @@ lima_nir_split_load_input_block(nir_block *block, nir_builder *b)
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,