[Mesa-dev] EXT_tetxure_swizzle and BGRA textures : glean test enhancement

Jose Fonseca jfonseca at vmware.com
Sun May 2 02:30:21 PDT 2010


I read the extension and it is not crystal clear, but it seems to imply the swizzles are orthogonal to the format, and applied as the very last step before being used in a shader. That is, the semantics are the same of adding a swizzle instruction after a TEX opcode, regardless of the format. At least this is my interpretation of 

  The values of the texture parameters TEXTURE_SWIZZLE_R_EXT,
    TEXTURE_SWIZZLE_G_EXT, TEXTURE_SWIZZLE_B_EXT, and 
    TEXTURE_SWIZZLE_A_EXT, are applied after the swizzling described
    in Table 3.20 (p. 186). The swizzle parameter 
    TEXTURE_SWIZZLE_R_EXT affects the first component of Cs as:

BGRA extension does not specify additions to the 3.20 table though (it's against spec 1.1) so this is why the guess work.

So my expectaction is that swizzling a BGRA with a .rgba swizzle will get bgra. 

It is also interesting the mention that the swizzle happens after texture compare mode.

Jose
________________________________________
From: mesa-dev-bounces+jfonseca=vmware.com at lists.freedesktop.org [mesa-dev-bounces+jfonseca=vmware.com at lists.freedesktop.org] On Behalf Of Dave Airlie [airlied at gmail.com]
Sent: Sunday, May 02, 2010 10:01
To: mesa-dev at lists.freedesktop.org
Subject: Re: [Mesa-dev] EXT_tetxure_swizzle and BGRA textures : glean test      enhancement

On Sat, May 1, 2010 at 6:47 PM, Dave Airlie <airlied at gmail.com> wrote:
> In looking at adding EXT_texture_swizzle I'm a bit confused about what
> exactly should happen with BGRA textures, as on r300 we use the
> texture swizzling to do BGRA, so we would have some interaction at
> that point.
>
> To make sure we test for this I've made the following enhancments to
> the glean test (in piglit tree - but I'll resubmit against glean tree
> if correct).
>
> Can someone with a clue make sure this is a sane test, it passes
> against swrast..
>

Hmm on a second look inside mesa, it appears it never stores textures
internally as BGRA, it always does a swizzle translate on the way in,
so this test won't help me there, I'll have to think up something a
bit more intricate to test this stuff.

Dave.
_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list