pan/bi: Elucidate slot 6/7 operation
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 16 Feb 2021 23:11:45 +0000 (18:11 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 18 Feb 2021 21:48:22 +0000 (21:48 +0000)
Used to order fragments. With that clarified it's clear that we need to
wait on slot 7 for LD_TILE too (outside the limited context of a blend
shader).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>

src/panfrost/bifrost/bi_schedule.c
src/panfrost/bifrost/bifrost.h

index 049d73e..0dc0fb3 100644 (file)
@@ -1319,11 +1319,21 @@ bi_schedule_clause(bi_context *ctx, bi_block *block, struct bi_worklist st)
                                 clause_state.message = true;
                         }
 
-                        if (tuple->add->op == BI_OPCODE_ATEST)
-                                clause->dependencies |= (1 << 6);
-
-                        if (tuple->add->op == BI_OPCODE_BLEND)
-                                clause->dependencies |= (1 << 6) | (1 << 7);
+                        switch (tuple->add->op) {
+                        case BI_OPCODE_ATEST:
+                                clause->dependencies |= (1 << BIFROST_SLOT_ELDEST_DEPTH);
+                                break;
+                        case BI_OPCODE_LD_TILE:
+                                if (!ctx->inputs->is_blend)
+                                        clause->dependencies |= (1 << BIFROST_SLOT_ELDEST_COLOUR);
+                                break;
+                        case BI_OPCODE_BLEND:
+                                clause->dependencies |= (1 << BIFROST_SLOT_ELDEST_DEPTH);
+                                clause->dependencies |= (1 << BIFROST_SLOT_ELDEST_COLOUR);
+                                break;
+                        default:
+                                break;
+                        }
                 }
 
                 clause_state.consts[idx] = bi_get_const_state(&tuple_state);
index c675206..304c082 100644 (file)
@@ -114,6 +114,12 @@ enum bifrost_flow {
         BIFROST_FLOW_WE = 7,
 };
 
+enum bifrost_slot {
+        /* 0-5 are general purpose */
+        BIFROST_SLOT_ELDEST_DEPTH = 6,
+        BIFROST_SLOT_ELDEST_COLOUR = 7,
+};
+
 struct bifrost_header {
         /* Reserved */
         unsigned zero1 : 5;