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 <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
This commit is contained in:
Alyssa Rosenzweig 2022-01-15 10:05:02 -05:00 committed by Marge Bot
parent 1e5bb54f59
commit 2bdfa4800d

View file

@ -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);