diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-05-01 18:26:18 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2020-05-04 11:08:15 -0400 |
commit | 7d867f787f9ada8b67e4d8ee6e9e388b6d6bc9bd (patch) | |
tree | fb3adf3f45e925523f717988539150ce82dc8895 /src | |
parent | c9ab73296c1c80796b6a3e8cfc1affb486e4dd81 (diff) |
pan/bi: Emit discard (not if)
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Diffstat (limited to 'src')
-rw-r--r-- | src/panfrost/bifrost/bifrost_compile.c | 18 |
1 files changed, 18 insertions, 0 deletions
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 @@ -352,6 +352,20 @@ bi_emit_ld_frag_coord(bi_context *ctx, nir_intrinsic_instr *instr) } 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) { nir_src cond = instr->src[0]; @@ -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; |