diff options
author | Erico Nunes <nunes.erico@gmail.com> | 2020-08-30 22:12:23 +0200 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-09-13 10:09:29 +0000 |
commit | 4868ce1451ffceb65a03ef230da01da639286c2c (patch) | |
tree | 194c5d7dd76e0dc900daaacf194fe6d334fb98ee | |
parent | bea6290ca090a7be7e7d51c9316cf68337ac4e1f (diff) |
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>
-rw-r--r-- | src/gallium/drivers/lima/ir/lima_nir_split_load_input.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 3c87a4847d1..676189fb5ab 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 @@ 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, |