wayland/vulkancontext: Sync surface state before vkQueuePresentKHR
authorJonas Ådahl <jadahl@gmail.com>
Wed, 21 Mar 2018 06:08:13 +0000 (14:08 +0800)
committerJonas Ådahl <jadahl@gmail.com>
Wed, 21 Mar 2018 06:14:32 +0000 (14:14 +0800)
A side effect of vkQueuePresentKHR is the Vulkan implementation calling
wl_surface_commit() on the corresponding Wayland surface. Thus, before
this, we must synchronize the surface state (e.g. opaque region, window
geometry, etc) that changed since last time. Prior to this commit this
was done after calling vkQueuePresentKHR(), causing the surface state to
always correspond to the previous buffer state. As of this commit this
is now done before calling vkQueuePresentKHR(), thus before
wl_surface_commit().

gdk/wayland/gdkvulkancontext-wayland.c

index 4e854697414a58655605aa8d85d797fd5e15d9b3..b5e82139f5bb91ed5ce34436af71a55bc097e379 100644 (file)
@@ -66,9 +66,9 @@ gdk_vulkan_context_wayland_end_frame (GdkDrawContext *context,
 {
   GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
 
-  GDK_DRAW_CONTEXT_CLASS (gdk_wayland_vulkan_context_parent_class)->end_frame (context, painted, damage);
-
   gdk_wayland_surface_sync (surface);
+
+  GDK_DRAW_CONTEXT_CLASS (gdk_wayland_vulkan_context_parent_class)->end_frame (context, painted, damage);
 }
 
 static void