mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
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.
This commit is contained in:
parent
30219cf76b
commit
8456ac6fa9
4 changed files with 119 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue