mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-10 12:40:10 +00:00
vulkan: Avoid a validation error
If vkAcquireNextImageKHR returns VK_SUBOPTIMAL_KHR, the semaphore is in use, but vkDeviceWaitIdle will not wait for it, since it is not associated with a queue. Make sure that is the case, so we don't run into a validation error when we try vkAcquireNextImageKHR with the same semaphore, after recreating the swap chain. See https://github.com/KhronosGroup/Vulkan-Docs/issues/1059 for some related discussion. Fixes: #7079
This commit is contained in:
parent
f66b32dca7
commit
caf2a7724f
@ -698,6 +698,22 @@ gdk_vulkan_context_begin_frame (GdkDrawContext *draw_context,
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (acquire_result == VK_SUBOPTIMAL_KHR)
|
||||
{
|
||||
const VkPipelineStageFlags mask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
|
||||
|
||||
vkQueueSubmit (gdk_vulkan_context_get_queue (context),
|
||||
1,
|
||||
&(VkSubmitInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
|
||||
.waitSemaphoreCount = 1,
|
||||
.pWaitSemaphores = &priv->draw_semaphore,
|
||||
.pWaitDstStageMask = &mask,
|
||||
},
|
||||
VK_NULL_HANDLE);
|
||||
vkQueueWaitIdle (gdk_vulkan_context_get_queue (context));
|
||||
}
|
||||
|
||||
if (gdk_vulkan_context_check_swapchain (context, &error))
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user