From 92d7563fba04219a0a96a4949182b1f94b6d79b0 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Thu, 1 Dec 2016 00:32:41 +0100 Subject: [PATCH] ac/nir: Only use the first component for SSBO atomics. Signed-off-by: Bas Nieuwenhuizen Reviewed-by: Dave Airlie --- src/amd/common/ac_nir_to_llvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 6b91e93f3cb..ec1ba9e55b3 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -1952,9 +1952,9 @@ static LLVMValueRef visit_atomic_ssbo(struct nir_to_llvm_context *ctx, ctx->shader_info->fs.writes_memory = true; if (instr->intrinsic == nir_intrinsic_ssbo_atomic_comp_swap) { - params[arg_count++] = get_src(ctx, instr->src[3]); + params[arg_count++] = llvm_extract_elem(ctx, get_src(ctx, instr->src[3]), 0); } - params[arg_count++] = get_src(ctx, instr->src[2]); + params[arg_count++] = llvm_extract_elem(ctx, get_src(ctx, instr->src[2]), 0); params[arg_count++] = get_src(ctx, instr->src[0]); params[arg_count++] = LLVMConstInt(ctx->i32, 0, false); /* vindex */ params[arg_count++] = get_src(ctx, instr->src[1]); /* voffset */ -- 2.30.2