From c4bd2e691b226f056a08a2cd3c2972f7984b138d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 16 Jan 2025 09:37:58 -0500 Subject: [PATCH] agx: defer printf address lowering this will be needed with vtn_bindgen2 Signed-off-by: Alyssa Rosenzweig Reviewed-by: Jesse Natalie Reviewed-by: Lionel Landwerlin Part-of: --- src/asahi/clc/asahi_clc.c | 2 -- src/asahi/compiler/agx_compile.c | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/asahi/clc/asahi_clc.c b/src/asahi/clc/asahi_clc.c index 059160fccbb..826b874099f 100644 --- a/src/asahi/clc/asahi_clc.c +++ b/src/asahi/clc/asahi_clc.c @@ -98,8 +98,6 @@ compile(void *memctx, const uint32_t *spirv, size_t spirv_size) NIR_PASS(_, nir, nir_lower_printf, &(const struct nir_lower_printf_options){ - .buffer_address = LIBAGX_PRINTF_BUFFER_ADDRESS, - .max_buffer_size = LIBAGX_PRINTF_BUFFER_SIZE - 8, }); /* We have to lower away local constant initializers right before we diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 07ca606844c..775d5e43aef 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -6,6 +6,7 @@ */ #include "agx_compile.h" +#include "asahi/clc/asahi_clc.h" #include "asahi/layout/layout.h" #include "compiler/nir/nir_builder.h" #include "util/bitset.h" @@ -3775,6 +3776,9 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key, if (nir->info.stage == MESA_SHADER_FRAGMENT) info->tag_write_disable = !nir->info.writes_memory; + NIR_PASS(_, nir, nir_lower_printf_buffer, LIBAGX_PRINTF_BUFFER_ADDRESS, + LIBAGX_PRINTF_BUFFER_SIZE - 8); + bool needs_libagx = true /* TODO: Optimize */; NIR_PASS(_, nir, nir_lower_frag_coord_to_pixel_coord);