From f4d2b35ac85245e1bb1d4ba497d8d4c5b11c8ae2 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 22 Dec 2020 11:53:20 -0500 Subject: [PATCH] pan/bi: Pipe scratch_size in from NIR Needs to be added to whatever we spill ourselves. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_ra.c | 2 +- src/panfrost/bifrost/bifrost_compile.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c index c7c2003bfd3..72b2d155ee7 100644 --- a/src/panfrost/bifrost/bi_ra.c +++ b/src/panfrost/bifrost/bi_ra.c @@ -311,7 +311,7 @@ bi_register_allocate(bi_context *ctx) unsigned iter_count = 1000; /* max iterations */ /* Number of bytes of memory we've spilled into */ - unsigned spill_count = 0; + unsigned spill_count = ctx->tls_size; do { if (l) { diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 86cc1ec1e08..82a40547039 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -2213,6 +2213,7 @@ bifrost_compile_shader_nir(void *mem_ctx, nir_shader *nir, program->sysval_count = ctx->sysvals.sysval_count; memcpy(program->sysvals, ctx->sysvals.sysvals, sizeof(ctx->sysvals.sysvals[0]) * ctx->sysvals.sysval_count); ctx->blend_types = program->blend_types; + ctx->tls_size = nir->scratch_size; nir_foreach_function(func, nir) { if (!func->impl)