summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-18 23:02:12 -0400
committerMarge Bot <[email protected]>2020-03-19 03:23:07 +0000
commitb18d0ef7081540b6c8d60bfd4f13792878ea1b28 (patch)
tree36bf0998542ad51e048204e1e6ba78bcf583d869 /src
parent61260819ba3f08fccf72dfe7d7498516eec413f9 (diff)
pan/bi: Flesh out ATEST in IR
ATEST actually takes two sources and has a destination. Although the details are a little funny, we should still model this correctly. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4242>
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/bifrost/bi_tables.c2
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c17
2 files changed, 17 insertions, 2 deletions
diff --git a/src/panfrost/bifrost/bi_tables.c b/src/panfrost/bifrost/bi_tables.c
index 03d1bb72a48..72d2ccf2155 100644
--- a/src/panfrost/bifrost/bi_tables.c
+++ b/src/panfrost/bifrost/bi_tables.c
@@ -28,7 +28,7 @@
unsigned bi_class_props[BI_NUM_CLASSES] = {
[BI_ADD] = BI_GENERIC | BI_MODS | BI_SCHED_ALL,
- [BI_ATEST] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD | BI_VECTOR,
+ [BI_ATEST] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD,
[BI_BRANCH] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD,
[BI_CMP] = BI_GENERIC | BI_MODS | BI_SCHED_ALL,
[BI_BLEND] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD | BI_VECTOR,
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 144afe61873..e19f0961e9b 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -120,7 +120,22 @@ bi_emit_frag_out(bi_context *ctx, nir_intrinsic_instr *instr)
{
if (!ctx->emitted_atest) {
bi_instruction ins = {
- .type = BI_ATEST
+ .type = BI_ATEST,
+ .src = {
+ BIR_INDEX_REGISTER | 60 /* TODO: RA */,
+ bir_src_index(&instr->src[0])
+ },
+ .src_types = {
+ nir_type_uint32,
+ nir_type_float32
+ },
+ .swizzle = {
+ { 0 },
+ { 3, 0 } /* swizzle out the alpha */
+ },
+ .dest = BIR_INDEX_REGISTER | 60 /* TODO: RA */,
+ .dest_type = nir_type_uint32,
+ .writemask = 0xF
};
bi_emit(ctx, ins);