diff options
author | Timothy Arceri <[email protected]> | 2018-01-16 17:45:30 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-01-18 10:26:58 +1100 |
commit | e2b9296146746635cd631c5212ae56f0cd270820 (patch) | |
tree | f7106b90f023acb9be1000b28a6a6e72e74dfa6b /src | |
parent | 409e15f26fd245dfa6645214c433cfe4e7b9a988 (diff) |
ac: fix buffer overflow bug in 64bit SSBO loads
Fixes: 441ee1e65b04 "radv/ac: Implement Float64 SSBO loads"
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 1dc64f87cc9..e07330ca5c8 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -2588,8 +2588,11 @@ static LLVMValueRef visit_load_buffer(struct ac_nir_context *ctx, ctx->ac.i1false, }; - results[i] = ac_build_intrinsic(&ctx->ac, load_name, data_type, params, 5, 0); + int idx = i; + if (instr->dest.ssa.bit_size == 64) + idx = i > 1 ? 1 : 0; + results[idx] = ac_build_intrinsic(&ctx->ac, load_name, data_type, params, 5, 0); } assume(results[0]); |