[Mesa-dev] EXT_tetxure_swizzle and BGRA textures : glean test enhancement
Dave Airlie
airlied at gmail.com
Sun May 2 02:36:18 PDT 2010
On Sun, May 2, 2010 at 7:30 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
> 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.
That is my interpretation as well, so in the r300 hw for example we
use the texture swizzle to implement bgra vs rgba formats, I'd need to
combine that with the incoming GL swizzle from the extension, but I'd
really like to have some sort of test case to demonstrate it as I'm
really not sure how ugly the combine swizzles function might end up.
But it looks as if I need to write a direct to gallium test case to
make sure I'm actually using things, mesa seems to block my attempts,
though maybe with something like a PBO I can make mesa do it.
Dave.
More information about the mesa-dev
mailing list