egl/wayland: manually swap backbuffer when using zink
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 1 Jun 2022 14:47:27 +0000 (10:47 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 3 Jun 2022 18:22:22 +0000 (18:22 +0000)
this would usually occur through dri2_wl_swrast_commit_backbuffer(),
but zink triggers this functionality using vulkan wsi, which fails to
perform these updates as expected

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16814>

src/egl/drivers/dri2/platform_wayland.c

index 01aff28..2fa55d9 100644 (file)
@@ -2579,6 +2579,10 @@ dri2_wl_swrast_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
       return _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_swap_buffers");
 
    dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable);
+   if (disp->Options.Zink) {
+      dri2_surf->current = dri2_surf->back;
+      dri2_surf->back = NULL;
+   }
    return EGL_TRUE;
 }