From e2b9296146746635cd631c5212ae56f0cd270820 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Tue, 16 Jan 2018 17:45:30 +1100 Subject: [PATCH] ac: fix buffer overflow bug in 64bit SSBO loads MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes: 441ee1e65b04 "radv/ac: Implement Float64 SSBO loads" Reviewed-by: Marek Olšák --- src/amd/common/ac_nir_to_llvm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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]); -- 2.30.2