diff options
author | Simon Ser <contact@emersion.fr> | 2022-12-02 19:15:16 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-12-06 14:54:09 +0000 |
commit | 8456ac6fa9dadadca0b69ee0a0b02e60fbd45427 (patch) | |
tree | 26cb058ffbf6c92136fc721bec0bcd5feed0ee5e /include/render | |
parent | 30219cf76b0c497783a3d04e1613504468e49dc7 (diff) |
render/vulkan: wait for DMA-BUF fences
The Vulkan spec doesn't guarantee that the driver will wait for
implicitly synchronized client buffers before texturing from them.
radv happens to perform the wait, but anv doesn't.
Fix this by extracting implicit fences from DMA-BUFs, importing
them into Vulkan as a VkSemaphore objects, and make the render pass
wait on these VkSemaphores.
Diffstat (limited to 'include/render')
-rw-r--r-- | include/render/vulkan.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/render/vulkan.h b/include/render/vulkan.h index 42b79bbd..66739c40 100644 --- a/include/render/vulkan.h +++ b/include/render/vulkan.h @@ -49,6 +49,7 @@ struct wlr_vk_device { PFN_vkWaitSemaphoresKHR waitSemaphoresKHR; PFN_vkGetSemaphoreCounterValueKHR getSemaphoreCounterValueKHR; PFN_vkGetSemaphoreFdKHR getSemaphoreFdKHR; + PFN_vkImportSemaphoreFdKHR importSemaphoreFdKHR; } api; uint32_t format_prop_count; @@ -280,6 +281,8 @@ struct wlr_vk_texture { // If imported from a wlr_buffer struct wlr_buffer *buffer; struct wlr_addon buffer_addon; + // For DMA-BUF implicit sync interop + VkSemaphore foreign_semaphores[WLR_DMABUF_MAX_PLANES]; }; struct wlr_vk_texture *vulkan_get_texture(struct wlr_texture *wlr_texture); |