From 04731e0dd22941ef4e9f7f535675347d7d64fb9a Mon Sep 17 00:00:00 2001 From: Lorenzo <88429075+lorentsob@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:15:56 +0100 Subject: [PATCH] vk_bindless_dimensions_test: size the set as the device does on MoltenVK (TEST-BINDLESS-DIMENSIONS-MOLTENVK) The test says it sizes set 0 as the D3D12 device does, but it passed vkGetDescriptorSetLayoutSupport's answer to size_bindings on every driver. The device does not ask MoltenVK (d3d12_vulkan_device.cpp): MoltenVK refuses every layout of maxPerSetDescriptors (1212) or more and runs the full set. With its answer the set stayed at the default 256 indices of each dimension and the test failed at "capacity > live_images" on a Mac instead of running. Ask for the driver ID and skip the query on MoltenVK, as the device does. On an Apple M5 Max (MoltenVK 1.4.2, macOS 27.2.1) the test now sizes each array to 65536, reads 5000 live images of each dimension through their indices, fills the rest and passes. Co-Authored-By: Claude Fable 5.2 --- runtime/test/vk_bindless_dimensions_test.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/runtime/test/vk_bindless_dimensions_test.cpp b/runtime/test/vk_bindless_dimensions_test.cpp index 3da8370d66..98d05b89ec 100644 --- a/runtime/test/vk_bindless_dimensions_test.cpp +++ b/runtime/test/vk_bindless_dimensions_test.cpp @@ -380,13 +380,20 @@ int main() { std::printf("device: %s\n", properties.properties.deviceName); // Sized as the D3D12 device sizes it (d3d12_vulkan_device.cpp): from the update-after-bind limits, past - // maxPerSetDescriptors where vkGetDescriptorSetLayoutSupport accepts the layout. + // maxPerSetDescriptors where vkGetDescriptorSetLayoutSupport accepts the layout. MoltenVK's answer is not asked + // for, as there: it refuses every layout of maxPerSetDescriptors (1212) or more and runs the full set, so with + // it the set would stay at the default 256 indices of each dimension and the test would fail on every Mac. BindlessFeatures features; features.update_after_bind = true; features.partially_bound = d.partially_bound; + VkPhysicalDeviceDriverProperties driver{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES}; + VkPhysicalDeviceProperties2 driver_properties{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, &driver}; + d.instance_fn("vkGetPhysicalDeviceProperties2")(d.physical, &driver_properties); + const bool moltenvk = driver.driverID == VK_DRIVER_ID_MOLTENVK; const auto layout_support = d.fn("vkGetDescriptorSetLayoutSupport"); const auto layout_supported = [&](const BindlessFeatures& candidate) { + if (moltenvk) return true; if (!layout_support) return false; const bindless::SetLayout layout(candidate); VkDescriptorSetLayoutSupport support{VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT};