From 7d867f787f9ada8b67e4d8ee6e9e388b6d6bc9bd Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 1 May 2020 18:26:18 -0400 Subject: [PATCH] pan/bi: Emit discard (not if) Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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; -- 2.30.2