From 94b92000427280cc0cc1574f11bef53f51c961d0 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 26 Jan 2024 12:22:40 -0400 Subject: [PATCH] asahi: add has_scratch to shader key some stages are unspillable Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.h | 3 +++ src/gallium/drivers/asahi/agx_state.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/asahi/compiler/agx_compile.h b/src/asahi/compiler/agx_compile.h index 8ced54419bc..ca7302b8120 100644 --- a/src/asahi/compiler/agx_compile.h +++ b/src/asahi/compiler/agx_compile.h @@ -230,6 +230,9 @@ struct agx_shader_key { /* Library routines to link against */ const nir_shader *libagx; + /* Whether scratch memory is available in the given shader stage */ + bool has_scratch; + union { struct agx_vs_shader_key vs; struct agx_fs_shader_key fs; diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 3a8c8f7c640..1178d34c9e3 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -1804,6 +1804,7 @@ agx_compile_nir(struct agx_device *dev, nir_shader *nir, dev->params.num_clusters_total > 1) || dev->params.num_dies > 1; key.libagx = dev->libagx; + key.has_scratch = true; NIR_PASS(_, nir, agx_nir_lower_sysvals, true); NIR_PASS(_, nir, agx_nir_layout_uniforms, compiled, &key.reserved_preamble);