diff options
author | Alex Smith <[email protected]> | 2017-03-16 16:40:07 +0000 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2017-03-17 09:35:48 +0100 |
commit | ce4058dafd2dd283addaa99e8d5b51e53f634f9b (patch) | |
tree | 49ed6c223a0c5fc7d64ba6d114184f4b8d58ad9c /src/amd/common | |
parent | e88cac1df03d01a9e8a1de1a4a2ee888149e727a (diff) |
radv/ac: Fix shared memory offset calculation
The index passed to get_shared_memory_ptr is an attribute slot index,
i.e. the index of a vec4 within LDS. Therefore this must be scaled by
sizeof(vec4) to give the LDS byte offset.
Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver")
Signed-off-by: Alex Smith <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
CC: <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 01346c35f71..6e36c192c3c 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -297,7 +297,7 @@ static LLVMValueRef get_shared_memory_ptr(struct nir_to_llvm_context *ctx, LLVMValueRef ptr; int addr_space; - offset = LLVMConstInt(ctx->i32, idx, false); + offset = LLVMConstInt(ctx->i32, idx * 16, false); ptr = ctx->shared_memory; ptr = LLVMBuildGEP(ctx->builder, ptr, &offset, 1, ""); |