[Mesa-dev] [PATCH 1/3] glx: remove glFlush call in glXSwapBuffers

Marek Olšák maraeo at gmail.com
Thu Nov 8 05:48:38 PST 2012


Flushing here is unnecessary. The drivers which always flush in dri2Throttle
or __DRI2flushExtensionRec::flush are just wasting time here.

st/mesa is updated to do what glFlush does.

XXX I guess some other drivers should be updated to flush by themselves
    if they don't?
---
 src/glx/glxcmds.c                    |    4 ----
 src/mesa/state_tracker/st_cb_flush.c |    1 +
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 394bf59..22392bc 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -781,10 +781,6 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
       __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
 
       if (pdraw != NULL) {
-         if (gc && drawable == gc->currentDrawable) {
-            glFlush();
-         }
-
          (*pdraw->psc->driScreen->swapBuffers)(pdraw, 0, 0, 0);
          return;
       }
diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c
index b4372ae..7c9f91f 100644
--- a/src/mesa/state_tracker/st_cb_flush.c
+++ b/src/mesa/state_tracker/st_cb_flush.c
@@ -79,6 +79,7 @@ display_front_buffer(struct st_context *st)
 void st_flush( struct st_context *st,
                struct pipe_fence_handle **fence )
 {
+   FLUSH_VERTICES(st->ctx, 0);
    FLUSH_CURRENT(st->ctx, 0);
 
    st_flush_bitmap_cache(st);
-- 
1.7.9.5



More information about the mesa-dev mailing list