pan/bi: Reserve r0-r3 in blend shaders

Blend shaders are passed the source color through r0-r3. Let's avoid
allocating those. The is definitely not the right solution but is good
enough for now.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7151>
This commit is contained in:
Boris Brezillon 2020-10-14 14:10:14 +02:00
parent 3432d0a3e5
commit 0d40460757
1 changed files with 9 additions and 2 deletions

View File

@ -69,8 +69,15 @@ bi_allocate_registers(bi_context *ctx, bool *success)
struct lcra_state *l =
lcra_alloc_equations(node_count, 1);
l->class_start[BI_REG_CLASS_WORK] = 0;
l->class_size[BI_REG_CLASS_WORK] = 64 * 4; /* R0 - R63, all 32-bit */
if (ctx->is_blend) {
/* R0-R3 are reserved for the blend input */
l->class_start[BI_REG_CLASS_WORK] = 4 * 4;
l->class_size[BI_REG_CLASS_WORK] = 64 * 4;
} else {
/* R0 - R63, all 32-bit */
l->class_start[BI_REG_CLASS_WORK] = 0;
l->class_size[BI_REG_CLASS_WORK] = 64 * 4;
}
bi_foreach_instr_global(ctx, ins) {
unsigned dest = ins->dest;