From 2bdfa4800d2ec1e616539b8b03085252d74a592f Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 15 Jan 2022 10:05:02 -0500 Subject: [PATCH] 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 Reported-by: Icecream95 Part-of: --- 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 ad0f015..78da739 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); -- 2.7.4