[PATCH xserver] glx: Fix attribute handling for GLX_TEXTURE_FORMAT_EXT

Eric Anholt eric at anholt.net
Tue May 1 21:11:27 UTC 2018


Adam Jackson <ajax at nwnk.net> writes:

> 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.

Hmm, I don't see any required default value for GLX_TEXTURE_FORMAT in
the spec.  I'm also concerned that we're going to break some backwards
compat here, so your alpha bits plan sounds pretty decent.

Also, you need to bump the attributes by 2, not 1, when adding a new
attribute to output. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180501/30c3138c/attachment.sig>


More information about the xorg-devel mailing list