diff options
author | Benjamin Otte <otte@redhat.com> | 2016-11-29 14:47:59 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-12-09 18:35:51 +0100 |
commit | e11a6a0e68fcddeaffb9133645508d33da95b428 (patch) | |
tree | 5a8a3e14a7f613d4805a2b2a10364edc39fcfefc | |
parent | e22cb94e50f4c1866722f9e0e67e363c4c580f30 (diff) | |
download | gtk+-e11a6a0e68fcddeaffb9133645508d33da95b428.tar.gz |
x11: Call gdk_display_sync() when creating Vulkan surfaces
The Vulkan driver wants to operate on an X Window that it is sure does
exist.
-rw-r--r-- | gdk/x11/gdkvulkancontext-x11.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdk/x11/gdkvulkancontext-x11.c b/gdk/x11/gdkvulkancontext-x11.c index 71f27e3365..0d1038fd38 100644 --- a/gdk/x11/gdkvulkancontext-x11.c +++ b/gdk/x11/gdkvulkancontext-x11.c @@ -39,6 +39,13 @@ gdk_x11_vulkan_context_create_surface (GdkVulkanContext *context, GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); + /* This is necessary so that Vulkan sees the Window. + * Usually, vkCreateXlibSurfaceKHR() will not cause a problem to happen as + * it just creates resources, but futher calls with the resulting surface + * do cause issues. + */ + gdk_display_sync (display); + return GDK_VK_CHECK (vkCreateXlibSurfaceKHR, gdk_vulkan_context_get_instance (context), &(VkXlibSurfaceCreateInfoKHR) { VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR, |