render/vulkan: fix missing DMA-BUF implicit read fence for textures

When we're reading from a DMA-BUF texture using implicit sync, we
need to (1) wait for any writer to be done and (2) prevent any
writers from mutating the texture while we're still reading. We
were doing (1) but not (2).

Fix this by calling dmabuf_import_sync_file() with DMA_BUF_SYNC_READ
for all DMA-BUF textures we've used in the render pass.
This commit is contained in:
Simon Ser 2026-02-14 17:57:42 +01:00 committed by Simon Zeni
parent 73bbad8433
commit 43b37e34d6

View file

@ -1066,6 +1066,13 @@ bool vulkan_sync_render_pass_release(struct wlr_vk_renderer *renderer,
if (!buffer_import_sync_file(pass->render_buffer->wlr_buffer, DMA_BUF_SYNC_WRITE, sync_file_fd)) {
goto out;
}
struct wlr_vk_render_pass_texture *pass_texture;
wl_array_for_each(pass_texture, &pass->textures) {
if (!buffer_import_sync_file(pass_texture->texture->buffer, DMA_BUF_SYNC_READ, sync_file_fd)) {
goto out;
}
}
}
ok = true;