vulkano
vulkano copied to clipboard
support for VK_KHR_external_fence(memory/semaphore)_*
Added in 1.0.54.0
Another question: Would VK_KHR_external_fence_fd
extension allow us to bind a Fence
to a POSIX fd, and connect vulkano with mio/tokio/futures?
Would VK_KHR_external_fence_fd extension allow us to bind a Fence to a POSIX fd, and connect vulkano with mio/tokio/futures?
Probably yes, although I don't really know mio.
I will test to see if it works...
Currently I create a Fence
in vulkano by Fence::from_pool
, then pass the raw fence to vkGetFenceFdKHR
, it returns the fd as -1
. Am i missing something?
From the specs:
If pGetFdInfo::handleType is VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR and the fence is signaled at the time vkGetFenceFdKHR is called, pFd may return the value -1 instead of a valid file descriptor.
If not both conditions are true, it's probably a bug in the driver.
Also you need an additional parameter when creating the fence, to tell the implementation that you want a file descriptor from it.
I see, I missed an extra VkExportFenceCreateInfoKHR
. Thanks for the help. I will update this issue if made any progress.
Tested. With the spec not mentioning the fd supporting select/epoll, enabling this extension could not glue vulkano & mio/tokio/futures (under 382 nvidia beta driver). So I guess that's it. The file descriptor is only meant to be used as a handler to connect multiple graphics APIs.
Just fyi, I'm working on external fences (for now) in my fork. Not sure if it will end up in a PR though
I started working on this in my fork (https://github.com/malte-v/vulkano/tree/external-objects) and added all the necessary functions, structs and constants to vk-sys
. Now we need to come up with a way to cleanly incorporate the new functionality with the existing API. Any ideas?
For those still interested, here's an initial attempt at this:
https://github.com/vulkano-rs/vulkano/pull/1467
@malte-v, I didn't see your vk-sys updates until now, but I would definitely love to see your changes land since it has things my attempt doesn't have!
This is now implemented.