On Mit, 2011-12-07 at 10:24 +0000, Dave Airlie wrote: 
> From: Dave Airlie <airl...@redhat.com>
> 
> This keeps track of the creation process and stores a drawable type,
> it then blocks DRI2 from getting called if the drawable is a pixmap.
> 
> v2: check if we have a GLX drawable, which means we aren't a pbuffer,
> avoid doing flush at all since its meant to be a no-op.
> 
> Suggested by Michel Dänzer <mic...@daenzer.net>
> Signed-off-by: Dave Airlie <airl...@redhat.com>

[...]

> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
> index c8ec9c2..634f0c5 100644
> --- a/src/glx/glxcmds.c
> +++ b/src/glx/glxcmds.c
> @@ -796,6 +797,11 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
>  #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
>     {
>        __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
> +      struct glx_drawable *glx_draw = GetGLXDrawable(dpy, drawable);
> +
> +      /* GLX specifies a swapbuffer on a Pixmap to be a no-op. */
> +      if (glx_draw && glx_draw->drawableType == GLX_PIXMAP_BIT)
> +         return;
>  
>        if (pdraw != NULL) {
>           if (gc && drawable == gc->currentDrawable) {

I think __glXSwapBuffersMscOML needs similar treatment:

        glXSwapBuffersMscOML is a no-op and will always return 0 if the
        specified drawable was created with a non-double-buffered
        GLXFBConfig or if the specified drawable is a GLXPixmap.

Looks good otherwise, thanks!


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to