Module: Mesa
Branch: main
Commit: 2bdfa4800d2ec1e616539b8b03085252d74a592f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2bdfa4800d2ec1e616539b8b03085252d74a592f

Author: Alyssa Rosenzweig <[email protected]>
Date:   Sat Jan 15 10:05:02 2022 -0500

pan/bi: Pull BLEND precolouring out of per-dest loop

Indentation fail. This should happen once per instruction, not once per
destination. In theory, this is a minor performance win; in practice,
it's simply less wrong.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Reported-by: Icecream95 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>

---

 src/panfrost/bifrost/bi_ra.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c
index ad0f015688c..78da7395267 100644
--- a/src/panfrost/bifrost/bi_ra.c
+++ b/src/panfrost/bifrost/bi_ra.c
@@ -312,23 +312,22 @@ bi_allocate_registers(bi_context *ctx, bool *success, 
bool full_regs)
                 bi_foreach_dest(ins, d) {
                         unsigned dest = bi_get_node(ins->dest[d]);
 
-                        /* Blend shaders expect the src colour to be in r0-r3 
*/
-                        if (ins->op == BI_OPCODE_BLEND &&
-                            !ctx->inputs->is_blend) {
-                                unsigned node = bi_get_node(ins->src[0]);
-                                assert(node < node_count);
-                                l->solutions[node] = 0;
-
-                                /* Dual source blend input in r4-r7 */
-                                node = bi_get_node(ins->src[4]);
-                                if (node < node_count)
-                                        l->solutions[node] = 4;
-                        }
-
                         if (dest < node_count)
                                 l->affinity[dest] = default_affinity;
                 }
 
+                /* Blend shaders expect the src colour to be in r0-r3 */
+                if (ins->op == BI_OPCODE_BLEND &&
+                    !ctx->inputs->is_blend) {
+                        unsigned node = bi_get_node(ins->src[0]);
+                        assert(node < node_count);
+                        l->solutions[node] = 0;
+
+                        /* Dual source blend input in r4-r7 */
+                        node = bi_get_node(ins->src[4]);
+                        if (node < node_count)
+                                l->solutions[node] = 4;
+                }
         }
 
         bi_compute_interference(ctx, l, full_regs);

Reply via email to