From f5305c1b44a81d8e022997e0f2f5bd7556be7dea Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Thu, 1 Mar 2018 20:17:38 +1100 Subject: [PATCH] ac: fix nir_intrinsic_shared_atomic_comp_swap handling Following on from 49879f377870 this makes sure we use the correct src index. Fixes cts test: KHR-GL46.compute_shader.atomic-case3 Reviewed-by: Dave Airlie --- src/amd/common/ac_nir_to_llvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index afe17a8f11d..0ffcd75c3ac 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -3998,7 +3998,7 @@ static LLVMValueRef visit_var_atomic(struct ac_nir_context *ctx, if (instr->intrinsic == nir_intrinsic_var_atomic_comp_swap || instr->intrinsic == nir_intrinsic_shared_atomic_comp_swap) { - LLVMValueRef src1 = get_src(ctx, instr->src[1]); + LLVMValueRef src1 = get_src(ctx, instr->src[src_idx + 1]); result = LLVMBuildAtomicCmpXchg(ctx->ac.builder, ptr, src, src1, LLVMAtomicOrderingSequentiallyConsistent, -- 2.30.2