From 8cf58ca961c0821bea1f1fe6ec6c4d50b805b4d5 Mon Sep 17 00:00:00 2001 From: butilly Date: Wed, 28 Oct 2026 19:34:29 +0000 Subject: [PATCH] wrapper: gate maintenance4 memory queries on base driver support --- src/vulkan/wrapper/wrapper_device.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/vulkan/wrapper/wrapper_device.c b/src/vulkan/wrapper/wrapper_device.c index 2602532d383..40d647eddf5 100644 --- a/src/vulkan/wrapper/wrapper_device.c +++ b/src/vulkan/wrapper/wrapper_device.c @@ -1604,6 +1604,19 @@ if (pdf2 && pdf2->features.f) { \ physical_device->instance->dispatch_handle, "vkGetDeviceProcAddr"); vk_device_dispatch_table_load(&device->dispatch_table, gdpa, device->dispatch_handle); + + /* Android's loader can return non-NULL core command trampolines even when + * the base ICD does not implement maintenance4. Do not call those stubs + * merely because we expose Vulkan 1.3: select the existing memory-query + * fallbacks using the base feature snapshot, before wrapper emulation. + */ + if (!physical_device->base_supported_features.maintenance4) { + device->dispatch_table.GetDeviceBufferMemoryRequirements = NULL; + device->dispatch_table.GetDeviceImageMemoryRequirements = NULL; + device->dispatch_table.GetDeviceImageSparseMemoryRequirements = NULL; + WRAPPER_LOG(info, "Using maintenance4 memory-query fallbacks: base feature unavailable"); + } + if (physical_device->emulate_vulkan13) wrapper_lower_missing_commands(device);