nir/lower_ubo_vec4: Fix align_mul=8 special case

In order for the load to never straddle the load can't extend past 8
bytes, not 16. For example a vec2 load with align_mul = 8 and
align_offset = 4 can straddle.

Fixes assertion failures when we stop pushing UBOs in the preamble on
a6xx.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
This commit is contained in:
Connor Abbott
2021-09-27 16:17:42 +02:00
committed by Marge Bot
parent 751f425c37
commit b516208a55

View File

@@ -134,7 +134,7 @@ nir_lower_ubo_vec4_lower(nir_builder *b, nir_instr *instr, void *data)
result = nir_vector_extract(b, result, component);
} else if (align_mul == 8 &&
align_offset + chan_size_bytes * intr->num_components <= 16) {
align_offset + chan_size_bytes * intr->num_components <= 8) {
/* Special case: Loading small vectors from offset % 8 == 0 can be done
* with just one load and one bcsel.
*/