From fa21722f1cb07f5e01ca1f45bae6d29d27bfa11a Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 24 Apr 2025 11:43:52 -0400 Subject: [PATCH] asahi: use zero/scratch page for null textures Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/agx_helpers.h | 4 ++-- src/asahi/vulkan/hk_device.c | 2 +- src/gallium/drivers/asahi/agx_state.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/asahi/lib/agx_helpers.h b/src/asahi/lib/agx_helpers.h index 39ea69e03d3..48e64ba4d2a 100644 --- a/src/asahi/lib/agx_helpers.h +++ b/src/asahi/lib/agx_helpers.h @@ -233,7 +233,7 @@ agx_set_null_texture(struct agx_texture_packed *tex) } static void -agx_set_null_pbe(struct agx_pbe_packed *pbe, uint64_t sink) +agx_set_null_pbe(struct agx_pbe_packed *pbe) { agx_pack(pbe, PBE, cfg) { cfg.width = 1; @@ -246,7 +246,7 @@ agx_set_null_pbe(struct agx_pbe_packed *pbe, uint64_t sink) cfg.swizzle_g = AGX_CHANNEL_R; cfg.swizzle_b = AGX_CHANNEL_R; cfg.swizzle_a = AGX_CHANNEL_R; - cfg.buffer = sink; + cfg.buffer = AGX_SCRATCH_PAGE_ADDRESS; } } diff --git a/src/asahi/vulkan/hk_device.c b/src/asahi/vulkan/hk_device.c index 0c826fbf527..796a510fbae 100644 --- a/src/asahi/vulkan/hk_device.c +++ b/src/asahi/vulkan/hk_device.c @@ -297,7 +297,7 @@ hk_upload_null_descriptors(struct hk_device *dev) uint32_t offset_tex, offset_pbe; agx_set_null_texture(&null_tex); - agx_set_null_pbe(&null_pbe, dev->rodata.null_sink); + agx_set_null_pbe(&null_pbe); hk_descriptor_table_add(dev, &dev->images, &null_tex, sizeof(null_tex), &offset_tex); diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index d7db8f0bb0b..f2053c23b5b 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -2767,7 +2767,7 @@ agx_upload_textures(struct agx_batch *batch, struct agx_compiled_shader *cs, if (!(ctx->stage[stage].image_mask & BITFIELD_BIT(i))) { agx_set_null_texture(texture); - agx_set_null_pbe(pbe, agx_pool_alloc_aligned(&batch->pool, 1, 64).gpu); + agx_set_null_pbe(pbe); continue; }