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.63k stars 402 forks source link

Implementing external semaphores #2253

Open nkhanhtranfb opened 3 weeks ago

nkhanhtranfb commented 3 weeks ago

Hi,

I'm writing an application that need access to external semaphore functionalities provided by these extensions VK_KHR_external_fence and VK_KHR_external_semaphore. These extensions are supported when querying the list of supported extensions, but when I query to get the properties of the semaphore using VK_KHR_external_fence_capabilities and VK_KHR_external_semaphore_capabilities, the handle types and semaphore features are all 0: https://github.com/KhronosGroup/MoltenVK/blob/e6b7806ad19957e0f1194c2a081013b9e6db2605/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm#L1323

Is this not implemented correctly in MoltenVK? Pardon my language if I made any mistake, I'm new to Vulkan & MoltenVK :).

cdavis5e commented 3 weeks ago

Based on my reading of the standard, it is legal for a Vulkan implementation to implement VK_KHR_external_semaphore without supporting any external handle types. Typically, supporting a handle type requires also supporting one of the handle-type extensions (e.g. VK_KHR_external_semaphore_fd).

Metal does support this functionality, but first we need to define extensions providing extension structures so you can, you know, actually import and export these objects, because none of the existing ones is adequate for Metal.