From b516208a5594bf4a7773e96eba8fff5dccb8d0fb Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Mon, 27 Sep 2021 16:17:42 +0200 Subject: [PATCH] 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: --- src/compiler/nir/nir_lower_ubo_vec4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_ubo_vec4.c b/src/compiler/nir/nir_lower_ubo_vec4.c index c0f5b1ca4ff..90885b133b4 100644 --- a/src/compiler/nir/nir_lower_ubo_vec4.c +++ b/src/compiler/nir/nir_lower_ubo_vec4.c @@ -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. */