From: Alyssa Rosenzweig Date: Fri, 1 May 2020 22:26:18 +0000 (-0400) Subject: pan/bi: Emit discard (not if) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d867f787f9ada8b67e4d8ee6e9e388b6d6bc9bd;p=mesa.git pan/bi: Emit discard (not if) Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 2b5b5070dd9..b5027e18b71 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -351,6 +351,20 @@ bi_emit_ld_frag_coord(bi_context *ctx, nir_intrinsic_instr *instr) bi_emit(ctx, combine); } +static void +bi_emit_discard(bi_context *ctx, nir_intrinsic_instr *instr) +{ + /* Goofy lowering */ + bi_instruction discard = { + .type = BI_DISCARD, + .cond = BI_COND_EQ, + .src_types = { nir_type_uint32, nir_type_uint32 }, + .src = { BIR_INDEX_ZERO, BIR_INDEX_ZERO }, + }; + + bi_emit(ctx, discard); +} + static void bi_emit_discard_if(bi_context *ctx, nir_intrinsic_instr *instr) { @@ -406,6 +420,10 @@ emit_intrinsic(bi_context *ctx, nir_intrinsic_instr *instr) bi_emit_ld_frag_coord(ctx, instr); break; + case nir_intrinsic_discard: + bi_emit_discard(ctx, instr); + break; + case nir_intrinsic_discard_if: bi_emit_discard_if(ctx, instr); break;