Merge branch 'vulkan-resize-fix' into 'main'

vulkan: Wait for device to be idle before create/recreating swapchain

See merge request GNOME/gtk!6183
This commit is contained in:
Benjamin Otte
2023-07-13 13:19:29 +00:00

View File

@@ -383,6 +383,13 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
device = gdk_vulkan_context_get_device (context);
/*
* Wait for device to be idle because this function is also called in window resizes.
* And if we destroy old swapchain it also destroy the old VkImages, those images could
* be in use by a vulkan render.
*/
vkDeviceWaitIdle (device);
res = GDK_VK_CHECK (vkGetPhysicalDeviceSurfaceCapabilitiesKHR, gdk_vulkan_context_get_physical_device (context),
priv->surface,
&capabilities);