From cce12981e462c0745f362e957e6d3454e12ad96e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 12 Feb 2024 13:19:37 -0500 Subject: [PATCH] egl/wayland: unify back/current swapping between zink and swrast these are functionally the same, they just happened in different places Acked-by: Daniel Stone Part-of: --- src/egl/drivers/dri2/platform_wayland.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index b78ed973de1..bce4aa46373 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -2373,9 +2373,6 @@ dri2_wl_swrast_commit_backbuffer(struct dri2_egl_surface *dri2_surf) dri2_surf); } - dri2_surf->current = dri2_surf->back; - dri2_surf->back = NULL; - wl_surface_attach(dri2_surf->wl_surface_wrapper, dri2_surf->current->wl_buffer, dri2_surf->dx, dri2_surf->dy); @@ -2518,10 +2515,11 @@ dri2_wl_swrast_swap_buffers_with_damage(_EGLDisplay *disp, _EGLSurface *draw, dri2_dpy->core->swapBuffersWithDamage(dri2_surf->dri_drawable, n_rects, rects); else dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable); - if (disp->Options.Zink) { - dri2_surf->current = dri2_surf->back; - dri2_surf->back = NULL; - } else { + + dri2_surf->current = dri2_surf->back; + dri2_surf->back = NULL; + + if (!disp->Options.Zink) { dri2_wl_swrast_commit_backbuffer(dri2_surf); } return EGL_TRUE;