diff options
author | Rhys Perry <[email protected]> | 2018-12-13 17:03:23 +0000 |
---|---|---|
committer | Rhys Perry <[email protected]> | 2018-12-16 14:56:10 +0000 |
commit | bde9f482de69528db5ccf5dd6bbfd8359adfbb19 (patch) | |
tree | eff0614abba5fabd7966e5a7b7871e4e285c762e | |
parent | 12dc7cb202a35e59e836b20a0f3510f257d1e0b0 (diff) |
ac: split 16-bit ssbo loads that may not be dword aligned
Fixes: 7e7ee826982 ('ac: add support for 16bit buffer loads')
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108114
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
-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; |