From: Karol Herbst Date: Wed, 13 Dec 2017 20:59:29 +0000 (+0100) Subject: nv50/ir/nir: implement intrinsic_discard(_if) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b05494c216fcb9bd6e02081d43d8d528fdb7f1da;p=mesa.git nv50/ir/nir: implement intrinsic_discard(_if) v9: use getSSA instead of new_LValue Signed-off-by: Karol Herbst --- diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index 70c4aecd699..5c372794e02 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp @@ -1732,6 +1732,20 @@ Converter::visit(nir_intrinsic_instr *insn) loadImm(newDefs[1], mode); break; } + case nir_intrinsic_discard: + mkOp(OP_DISCARD, TYPE_NONE, NULL); + break; + case nir_intrinsic_discard_if: { + Value *pred = getSSA(1, FILE_PREDICATE); + if (insn->num_components > 1) { + ERROR("nir_intrinsic_discard_if only with 1 component supported!\n"); + assert(false); + return false; + } + mkCmp(OP_SET, CC_NE, TYPE_U8, pred, TYPE_U32, getSrc(&insn->src[0], 0), zero); + mkOp(OP_DISCARD, TYPE_NONE, NULL)->setPredicate(CC_P, pred); + break; + } default: ERROR("unknown nir_intrinsic_op %s\n", nir_intrinsic_infos[op].name); return false;