summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-03-01 20:17:38 +1100
committerTimothy Arceri <[email protected]>2018-03-02 09:11:20 +1100
commitf5305c1b44a81d8e022997e0f2f5bd7556be7dea (patch)
treef7231a502e20e039f12183d8c48e982fbbac84f7 /src
parent13cdf4e5906f2ac7ec39d0b06abc6b5671c0693d (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c2
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 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,