clients: Fix dmabuf feedback stall in simple-vulkan

When we receive dmabuf feedback, we hit the VK_SUBOPTIMAL path and
recreate the swapchain, returning early without submitting work.

However, we've already reset the fence before we do this, so we'll
block forever waiting for work that never comes to signal it.

Instead, we should reset the fence right before we know we're submitting
work.

Fixes: 75c37afa ("clients/simple-vulkan: New Vulkan client example")

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
(cherry picked from commit af736168f7)
This commit is contained in:
Derek Foreman 2026-03-27 13:35:47 -05:00 committed by Marius Vlad
parent f0fa8b9b18
commit 71191cd127

View file

@ -1564,7 +1564,6 @@ redraw(struct window *window)
assert(window->vk.frame_index < ARRAY_LENGTH(window->vk.frames));
vkWaitForFences(window->vk.dev, 1, &frame->fence, VK_TRUE, UINT64_MAX);
vkResetFences(window->vk.dev, 1, &frame->fence);
uint32_t image_index;
result = vkAcquireNextImageKHR(window->vk.dev, window->vk.swapchain, UINT64_MAX,
@ -1575,6 +1574,8 @@ redraw(struct window *window)
}
assert(result == VK_SUCCESS);
vkResetFences(window->vk.dev, 1, &frame->fence);
assert(image_index < ARRAY_LENGTH(window->vk.images));
struct window_image *image = &window->vk.images[image_index];