KhronosGroup / MoltenVK

MoltenVK is a Vulkan Portability implementation. It layers a subset of the high-performance, industry-standard Vulkan graphics and compute API over Apple's Metal graphics framework, enabling Vulkan applications to run on macOS, iOS and tvOS.
Apache License 2.0
4.64k stars 402 forks source link

regression bug with vkGetBufferDeviceAddress #2174

Open awolven opened 4 months ago

awolven commented 4 months ago

The short of it is that I am able to get vkBufferDeviceAddress to work properly with the build of MoltenVK that comes with the VulkanSDK 1.3.261.1. This is with a 2016ish Intel MacBook Pro with an AMD Radeon Pro 455 running MacOS 12.7.3. I'm not sure which version of MoltenVK that ships with VulkanSDK 1.3.261.1 but I suspect it may be 1.1.11.

I cannot get vkBufferDeviceAddress to work with any newer (custom built) version of MoltenVK.

My tests used various versions of MoltenVK with 1.1.11 [per instructions] and with 1.2.0 to 1.2.7+ [with the latest SPIRV-Cross] (as there is an atomics fix there that I need that will only compile with 1.2.0+.). The builds generally worked with the latest SPIRV-Cross with the exception of buffer device address. I would find it unlikely that having used the latest SPIRV-Cross in those builds caused an issue with buffer device address.

I'm using Xcode 13.4.1. results: MoltenVK latest: Support for the buffer device address extension for my GPU has been removed entirely. v1.2.0 through v1.2.6: vkBufferDeviceAddress returns 0. v1.1.11 (with normal SPIRV-Cross): vkBufferDeviceAddress is segfaulting. Not sure why. Didn't test anything earlier.

So I am stuck. I need 1.2.x MoltenVK to run the atomics patch in spriv-cross, but can only get buffer device address to work with an old VulkanSDK.

billhollings commented 3 months ago

Vulkan SDK 1.3.261 ships with MoltenVK v1.2.5.

VK_KHR_buffer_device_address and VK_EXT_buffer_device_address are supported in the latest MoltenVK, and are currently passing about 90% of the CTS tests. It's possible you are encountering an issue, but we'd need more information to determine that.

There have been some recent improvements to MoltenVK in handling atomics. Try running your app with the latest version of MoltenVK (and the SPIRV-Cross that it retrieves automatically), and see if you find improvements.