glx: move the glFlush call one layer down
[mesa.git] / src / glx / dri_glx.c
index f42db79ad61760d7c120a1e2873ae61d1b095fa0..ba8fda20ad2be8812bbf1688b175527fa5705ad5 100644 (file)
@@ -684,22 +684,30 @@ driCreateDrawable(struct glx_screen *base,
 
 static int64_t
 driSwapBuffers(__GLXDRIdrawable * pdraw, int64_t unused1, int64_t unused2,
-              int64_t unused3)
+              int64_t unused3, Bool flush)
 {
    struct dri_screen *psc = (struct dri_screen *) pdraw->psc;
    struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
 
+   if (flush) {
+      glFlush();
+   }
+
    (*psc->core->swapBuffers) (pdp->driDrawable);
    return 0;
 }
 
 static void
 driCopySubBuffer(__GLXDRIdrawable * pdraw,
-                 int x, int y, int width, int height)
+                 int x, int y, int width, int height, Bool flush)
 {
    struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
    struct dri_screen *psc = (struct dri_screen *) pdp->base.psc;
 
+   if (flush) {
+      glFlush();
+   }
+
    (*psc->driCopySubBuffer->copySubBuffer) (pdp->driDrawable,
                                            x, y, width, height);
 }