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

Michel Dänzer michel at daenzer.net
Thu Nov 8 06:04:36 PST 2012


On Don, 2012-11-08 at 14:48 +0100, Marek Olšák wrote: 
> 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();
> -         }
> -

This behaviour is described rather explicitly in the GLX spec, so it
seems kind of weird to remove this and then ensure the glXSwapBuffers
semantics in non-GLX code. Would it be possible to eliminate the flushes
in non-GLX code instead, or at least make them less expensive?


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list