[Mesa-dev] confusions about new MESA_FORMAT_xxx convention
Brian Paul
brianp at vmware.com
Mon Mar 3 09:06:01 PST 2014
On 03/03/2014 08:32 AM, Chia-I Wu wrote:
> Hi list,
>
> From formats.h, we have
>
> /* Type P formats */ /* msb <------ TEXEL BITS -----------> lsb */
> /* ---- ---- ---- ---- ---- ---- ---- ---- */
> MESA_FORMAT_A8B8G8R8_UNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
>
> But in format_unpack.c, MESA_FORMAT_A8B8G8R8_UNORM is unpacked with
> unpack_RGBA8888, which has
>
> dst[i][RCOMP] = UBYTE_TO_FLOAT( (s[i] >> 24) );
> dst[i][GCOMP] = UBYTE_TO_FLOAT( (s[i] >> 16) & 0xff );
> dst[i][BCOMP] = UBYTE_TO_FLOAT( (s[i] >> 8) & 0xff );
> dst[i][ACOMP] = UBYTE_TO_FLOAT( (s[i] ) & 0xff );
>
> I am confused whether R should be at MSB, as the code does, or A
> should be at MSB, as the comment says.
>
> The format is mapped to PIPE_FORMAT_ABGR8888_UNORM, which suggests we
> have the right code but wrong comment.
>
I posted a patch last week which fixes the comments to make them agree
with the code. Still waiting for R-b.
-Brian
More information about the mesa-dev
mailing list