summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2020-10-14 14:10:14 +0200
committerBoris Brezillon <boris.brezillon@collabora.com>2020-10-15 08:05:23 +0200
commit0d40460757b809c8c28ee78f79e87a01e79bc518 (patch)
tree4931156b98722cd7863a835718354ba81075d82e
parent3432d0a3e53896348d840176722be46d080ad439 (diff)
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>
-rw-r--r--src/panfrost/bifrost/bi_ra.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c
index 6760546f0aa..7a3b307eedc 100644
--- a/src/panfrost/bifrost/bi_ra.c
+++ b/src/panfrost/bifrost/bi_ra.c
@@ -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;