summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-24 18:40:17 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-31 14:55:40 +0200
commitaa66fec47e6139ff50959b1326d621f2213ccc06 (patch)
tree6e0b2945de43f0d0967d00d181d399c3a64e5fde
parent4ba201ee361a07a084665e022efd6b0d6df2ffd6 (diff)
ac/nir: pass ac_nir_context to emit_discard_if
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--src/amd/common/ac_nir_to_llvm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index ecddb5e9b9..47f17b2f65 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3623,18 +3623,18 @@ static void emit_barrier(struct nir_to_llvm_context *ctx)
ctx->voidt, NULL, 0, AC_FUNC_ATTR_CONVERGENT);
}
-static void emit_discard_if(struct nir_to_llvm_context *ctx,
+static void emit_discard_if(struct ac_nir_context *ctx,
const nir_intrinsic_instr *instr)
{
LLVMValueRef cond;
- cond = LLVMBuildICmp(ctx->builder, LLVMIntNE,
- get_src(ctx->nir, instr->src[0]),
- ctx->i32zero, "");
+ cond = LLVMBuildICmp(ctx->ac.builder, LLVMIntNE,
+ get_src(ctx, instr->src[0]),
+ ctx->ac.i32_0, "");
- cond = LLVMBuildSelect(ctx->builder, cond,
- LLVMConstReal(ctx->f32, -1.0f),
- ctx->f32zero, "");
+ cond = LLVMBuildSelect(ctx->ac.builder, cond,
+ LLVMConstReal(ctx->ac.f32, -1.0f),
+ ctx->ac.f32_0, "");
ac_build_kill(&ctx->ac, cond);
}
@@ -4090,7 +4090,7 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
NULL, 0, AC_FUNC_ATTR_LEGACY);
break;
case nir_intrinsic_discard_if:
- emit_discard_if(ctx->nctx, instr);
+ emit_discard_if(ctx, instr);
break;
case nir_intrinsic_memory_barrier:
emit_waitcnt(ctx->nctx, VM_CNT);