diff options
author | Marek Olšák <[email protected]> | 2012-11-13 17:06:37 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-12-02 00:15:00 +0100 |
commit | 5b7e9b73603ce5fb48cc30896df277df0ae89856 (patch) | |
tree | 7840be63f07549f565283a81e41e7d279a9433e4 /src/glx/dri2_glx.c | |
parent | 8ad9d42b338c6684930b7898734f9070b6368172 (diff) |
glx: move the glFlush call one layer down
Diffstat (limited to 'src/glx/dri2_glx.c')
-rw-r--r-- | src/glx/dri2_glx.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 12b302601e1..30f6913010a 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -534,7 +534,7 @@ dri2Throttle(struct dri2_screen *psc, static void __dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y, int width, int height, - enum __DRI2throttleReason reason) + enum __DRI2throttleReason reason, Bool flush) { struct dri2_drawable *priv = (struct dri2_drawable *) pdraw; struct dri2_screen *psc = (struct dri2_screen *) pdraw->psc; @@ -550,6 +550,10 @@ __dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y, xrect.width = width; xrect.height = height; + if (flush) { + glFlush(); + } + if (psc->f) (*psc->f->flush) (priv->driDrawable); @@ -571,10 +575,10 @@ __dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y, static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y, - int width, int height) + int width, int height, Bool flush) { __dri2CopySubBuffer(pdraw, x, y, width, height, - __DRI2_THROTTLE_COPYSUBBUFFER); + __DRI2_THROTTLE_COPYSUBBUFFER, flush); } @@ -731,7 +735,7 @@ static void show_fps(struct dri2_drawable *draw) static int64_t dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, - int64_t remainder) + int64_t remainder, Bool flush) { struct dri2_drawable *priv = (struct dri2_drawable *) pdraw; struct glx_display *dpyPriv = __glXInitialize(priv->base.psc->dpy); @@ -747,7 +751,7 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, /* Old servers can't handle swapbuffers */ if (!pdp->swapAvailable) { __dri2CopySubBuffer(pdraw, 0, 0, priv->width, priv->height, - __DRI2_THROTTLE_SWAPBUFFER); + __DRI2_THROTTLE_SWAPBUFFER, flush); } else { xcb_connection_t *c = XGetXCBConnection(pdraw->psc->dpy); xcb_dri2_swap_buffers_cookie_t swap_buffers_cookie; @@ -756,6 +760,10 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, uint32_t divisor_hi, divisor_lo; uint32_t remainder_hi, remainder_lo; + if (flush) { + glFlush(); + } + if (psc->f) { struct glx_context *gc = __glXGetCurrentContext(); |