[Mesa-dev] [PATCH 3/3] dri3: Add GLX_EXT_buffer_age support

Robert Bragg robert at sixbynine.org
Mon Feb 24 08:58:54 PST 2014


Hi Adel,

Thanks for look at this; just a few comments...

> diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
> index 978730c..afb4206 100644
> --- a/src/glx/glx_pbuffer.c
> +++ b/src/glx/glx_pbuffer.c
> @@ -373,6 +373,14 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
>              if (!pdraw->textureFormat)
>                 pdraw->textureFormat =
>                    determineTextureFormat((const int *) data, num_attributes);
> +
> +            if (attribute == GLX_BACK_BUFFER_AGE_EXT) {
> +               struct glx_screen *psc = pdraw->psc;
> +
> +               if (psc->driScreen->getBufferAge != NULL)
> +                 *value = psc->driScreen->getBufferAge(pdraw);
> +            }
> +
>           }
>  #endif

Since with dri3 this is a client side only attribute, shouldn't we be
able to simply skip the redundant X round trip above to query the
drawable's attributes?

Technically we're supposed to report a GLXBadDrawable if the drawable
isn't currently bound to the current thread's context. I think the
requirement to be bound to a context was added to the spec considering
that if an app were switching between a direct/indirect context the
age state may switch from being client-side to server-side and they
shouldn't have to be kept in sync. glXSwapBuffers has a similar
requirement so it should be possible to borrow some checks from there.

Apart from that, this patch looks good to me:

Reviewed-by: Robert Bragg <robert at sixbynine.org>

--
Regards,
Robert


More information about the mesa-dev mailing list