diff options
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 2f68e0dcf1e..73e4d41c3b3 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -1640,6 +1640,8 @@ static LLVMValueRef visit_load_buffer(struct ac_nir_context *ctx, LLVMValueRef results[4]; for (int i = 0; i < num_components;) { int num_elems = num_components - i; + if (elem_size_bytes < 4 && nir_intrinsic_align(instr) % 4 != 0) + num_elems = 1; if (num_elems * elem_size_bytes > 16) num_elems = 16 / elem_size_bytes; int load_bytes = num_elems * elem_size_bytes; |