egl: Add a note explaining the swapBuffers badness in dri2_x11_copy_buffers().

I tried to drop the swapBuffers path, but it turns out it's being taken by
softpipe/llvmpipe, and the tests are passing.  The piglit egl-copy-buffers
test even passes on zink, but you end up with a bad display because of an
un-preserved back buffer.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>
This commit is contained in:
Emma Anholt
2023-02-14 14:48:32 -08:00
committed by Marge Bot
parent a6b850e335
commit 3e1b40be54

View File

@@ -1034,8 +1034,15 @@ dri2_x11_copy_buffers(_EGLDisplay *disp, _EGLSurface *surf, void *native_pixmap_
if (dri2_dpy->flush) if (dri2_dpy->flush)
dri2_dpy->flush->flush(dri2_surf->dri_drawable); dri2_dpy->flush->flush(dri2_surf->dri_drawable);
else else {
/* This should not be a swapBuffers, because it could present an
* incomplete frame, and it could invalidate the back buffer if it's not
* preserved. We really do want to flush. But it ends up working out
* okay-ish on swrast because those aren't invalidating the back buffer on
* swap.
*/
dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable); dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable);
}
gc = xcb_generate_id(dri2_dpy->conn); gc = xcb_generate_id(dri2_dpy->conn);
xcb_create_gc(dri2_dpy->conn, gc, target, 0, NULL); xcb_create_gc(dri2_dpy->conn, gc, target, 0, NULL);