[PATCH xserver] glx: Fix attribute handling for GLX_TEXTURE_FORMAT_EXT

Adam Jackson ajax at nwnk.net
Mon Apr 2 20:07:02 UTC 2018


On Mon, 2018-04-02 at 14:52 -0400, Adam Jackson wrote:

> @@ -1737,6 +1740,9 @@ __glXDisp_BindTexImageEXT(__GLXclientState * cl, GLbyte * pc)
>                            DixReadAccess, &pGlxDraw, &error))
>          return error;
>  
> +    if (pGlxDraw->format == GLX_TEXTURE_FORMAT_NONE_EXT)
> +        return BadMatch;
> +
>      if (!context->bindTexImage)
>          return __glXError(GLXUnsupportedPrivateRequest);
> 

The conditional added here is correct in a specification sense, but the
behavior change would be subtle. As it stands you can do
glXBindTexImage on _any_ GLX pixmap, even one created without a
texture-target attribute; due to accident of how various conditionals
are written it looks like such pixmaps would implicitly be treated as
RGBA. I'm not aware of any apps that do that and I don't think they
would work on non-Mesa drivers, but we could instead set a default
texture target derived from (the number of alpha bits of) the requested
fbconfig and it would probably do the right thing.

- ajax


More information about the xorg-devel mailing list