diff options
author | Alan Hourihane <[email protected]> | 2009-02-19 18:39:08 +0000 |
---|---|---|
committer | Alan Hourihane <[email protected]> | 2009-02-23 20:28:11 +0000 |
commit | 65562453fba69e862d5e3b381d18db9c40d9353c (patch) | |
tree | 02f8b11eace9763d3b6dd61773a0193dd2417c3a /src | |
parent | 4fc7cde770a66ff5bcf817af33a7b0b2c04354d5 (diff) |
glx: add support for a reallyFlush() function before swap occurs.
Diffstat (limited to 'src')
-rw-r--r-- | src/glx/x11/dri2_glx.c | 16 | ||||
-rw-r--r-- | src/glx/x11/dri_common.c | 7 | ||||
-rw-r--r-- | src/glx/x11/glxclient.h | 4 |
3 files changed, 27 insertions, 0 deletions
diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c index 776a14f614a..0ef5d3ab56f 100644 --- a/src/glx/x11/dri2_glx.c +++ b/src/glx/x11/dri2_glx.c @@ -208,7 +208,13 @@ static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw, xrect.width = width; xrect.height = height; +#ifdef __DRI2_FLUSH + if (pdraw->psc->f) + (*pdraw->psc->f->flush)(pdraw->driDrawable); +#endif + region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1); + /* should get a fence ID back from here at some point */ DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region, DRI2BufferFrontLeft, DRI2BufferBackLeft); XFixesDestroyRegion(pdraw->psc->dpy, region); @@ -236,6 +242,11 @@ static void dri2WaitX(__GLXDRIdrawable *pdraw) xrect.width = priv->width; xrect.height = priv->height; +#ifdef __DRI2_FLUSH + if (pdraw->psc->f) + (*pdraw->psc->f->flush)(pdraw->driDrawable); +#endif + region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1); DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); @@ -256,6 +267,11 @@ static void dri2WaitGL(__GLXDRIdrawable *pdraw) xrect.width = priv->width; xrect.height = priv->height; +#ifdef __DRI2_FLUSH + if (pdraw->psc->f) + (*pdraw->psc->f->flush)(pdraw->driDrawable); +#endif + region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1); DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); diff --git a/src/glx/x11/dri_common.c b/src/glx/x11/dri_common.c index 4fda649e59a..90c3d8c7d9d 100644 --- a/src/glx/x11/dri_common.c +++ b/src/glx/x11/dri_common.c @@ -392,6 +392,13 @@ driBindExtensions(__GLXscreenConfigs *psc, int dri2) } #endif +#ifdef __DRI2_FLUSH + if ((strcmp(extensions[i]->name, __DRI2_FLUSH) == 0) && dri2) { + psc->f = (__DRI2flushExtension *) extensions[i]; + /* internal driver extension, no GL extension exposed */ + } +#endif + /* Ignore unknown extensions */ } } diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 3e70759a6c4..caf58bbd44a 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -519,6 +519,10 @@ struct __GLXscreenConfigsRec { const __DRItexBufferExtension *texBuffer; #endif +#ifdef __DRI2_FLUSH + const __DRI2flushExtension *f; +#endif + #endif /** |