[Mesa-dev] [PATCH 2/2] st/xlib: Flush the front buffer before doing CopySubBuffer

Stéphane Marchesin marcheu at chromium.org
Sat May 11 13:38:36 PDT 2013


We flush pending rendering before running CopySubBuffer, which
ensures that the right bits get to the screen.
---
 src/gallium/state_trackers/glx/xlib/xm_api.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
index 4f10b84..08e8890 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -1254,6 +1254,10 @@ void XMesaSwapBuffers( XMesaBuffer b )
  */
 void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height )
 {
+   XMesaContext xmctx = XMesaGetCurrentContext();
+
+   xmctx->st->flush( xmctx->st, ST_FLUSH_FRONT, NULL);
+
    xmesa_copy_st_framebuffer(b->stfb,
          ST_ATTACHMENT_BACK_LEFT, ST_ATTACHMENT_FRONT_LEFT,
          x, b->height - y - height, width, height);
-- 
1.8.2.1



More information about the mesa-dev mailing list