From f97b041e87fc9a0d040b8f0fa037eb3717be8402 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 26 Jan 2024 14:26:37 -0400 Subject: [PATCH] agx: set nr_preamble_gprs for preamble scratch Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index b654935b40c..6a5938df982 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -2878,8 +2878,11 @@ agx_compile_function_nir(nir_shader *nir, nir_function_impl *impl, unsigned nr_gprs = ctx->max_reg + 1; + /* If the preamble uses scratch (due to spilling), we need to set maximal + * GPRs. Do it here so the driver doesn't have to worry about it. + */ if (impl->function->is_preamble) - out->nr_preamble_gprs = nr_gprs; + out->nr_preamble_gprs = ctx->scratch_size ? 256 : nr_gprs; else out->nr_gprs = nr_gprs;