From b13e3adb04e55789bbabcbb46dfc7f6eb6d764bd Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 20 Nov 2023 10:35:03 -0400 Subject: [PATCH] asahi: fix imageSize of null image Fixes faulting in imageAtomicAdd/unbound image test. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/shaders/texture.cl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/asahi/lib/shaders/texture.cl b/src/asahi/lib/shaders/texture.cl index cb768cc37f1..2d68b19ced2 100644 --- a/src/asahi/lib/shaders/texture.cl +++ b/src/asahi/lib/shaders/texture.cl @@ -13,6 +13,13 @@ libagx_txs(constant struct agx_texture_packed *ptr, uint16_t lod, { agx_unpack(NULL, ptr, TEXTURE, d); + /* From the Vulkan spec: + * + * OpImageQuery*... return 0 if the bound descriptor is a null descriptor + */ + if (d.null) + return 0; + /* Buffer textures are lowered to 2D so the original size is irrecoverable. * Instead, we stash it in the software-defined section. */