Is there anyway I can know which fence is signaled by using vkWaitForFences
(waitAll is false)? Currently I have to iterate all fences by using vkGetFenceStatus
if vkWaitForFences
returns, which is not very efficiency. (sort of evolute from select to epoll).
I found vkGetFenceFdKHR , but the doc said it is a POSIX file descriptor handle, I guess it is not portable.
It’s portable, except to Windows. For Windows, I believe the corresponding call is:
Background: In Vulkan with semaphores and memory objects, there’s a Windows vs. everything else split. With fences for instance:
- VK_KHR_external_fence_fd - POSIX (e.g. Linux)
- VK_KHR_external_fence_win32 - Windows
That split carries through to the OpenGL extensions which interop with it.
The best hint I’ve seen on the why is in NVIDIA’s presentation of the Vulkan interop extensions for OpenGL back in 2017 (see p. 56):
Related:
- New extension for linking fences with OS events/file handles (Khronos Vulkan-Docs Issue #310)
- Means for calling back from Vulkan to host application (stackoverflow)
- Support for VK_khr_external_fence(memory/semaphore)_* (vulkano-rs Issue #666)
Bad thing is that the doc says nothing about whether the file should support select/poll/epoll, and I checked that a lot of drivers just only create a fd, nothing else, so I guess neither vkGetFenceFdKHR nor vkGetFenceWin32HandleKHR is safe for what I want.
I’m no expert, but this might be what you’re looking for:
VkExternalFenceHandleTypeFlagBits:
Similarly for semaphores.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.