ac/nir: Only use the first component for SSBO atomics.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 30 Nov 2016 23:32:41 +0000 (00:32 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 5 Dec 2016 00:40:54 +0000 (01:40 +0100)
Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 6b91e93f3cb5e66e335e9a643699c4ddfe945266..ec1ba9e55b3d0ddf131a0d7463eea8cd25546111 100644 (file)
@@ -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 */