mesa: Add comments about bit-ordering of new XRGB/XBGR formats.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 29 Apr 2013 06:33:39 +0000 (23:33 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 12 May 2013 16:32:42 +0000 (09:32 -0700)
Marek added these new formats in commit f9fa725690c470daf308, but
without comments relating to the packing.  Sometimes the naming is
confusing, so these comments are helpful in determining whether two
formats are compatible.

The new comments are based on my reading of format_unpack.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
src/mesa/main/formats.h

index 5bfeedf85dbce8a4e752d711fc0e8ae866ce07d6..8dd71a086f53272f8f4e85662872d729f644d5c1 100644 (file)
@@ -289,21 +289,21 @@ typedef enum
    MESA_FORMAT_ARGB2101010_UINT,
    MESA_FORMAT_ABGR2101010_UINT,
 
-   MESA_FORMAT_XRGB4444_UNORM,
-   MESA_FORMAT_XRGB1555_UNORM,
-   MESA_FORMAT_XBGR8888_SNORM,
-   MESA_FORMAT_XBGR8888_SRGB,
-   MESA_FORMAT_XBGR8888_UINT,
-   MESA_FORMAT_XBGR8888_SINT,
-   MESA_FORMAT_XRGB2101010_UNORM,
-   MESA_FORMAT_XBGR16161616_UNORM,
-   MESA_FORMAT_XBGR16161616_SNORM,
-   MESA_FORMAT_XBGR16161616_FLOAT,
-   MESA_FORMAT_XBGR16161616_UINT,
-   MESA_FORMAT_XBGR16161616_SINT,
-   MESA_FORMAT_XBGR32323232_FLOAT,
-   MESA_FORMAT_XBGR32323232_UINT,
-   MESA_FORMAT_XBGR32323232_SINT,
+   MESA_FORMAT_XRGB4444_UNORM,    /*                     xxxx RRRR GGGG BBBB */
+   MESA_FORMAT_XRGB1555_UNORM,    /*                     xRRR RRGG GGGB BBBB */
+   MESA_FORMAT_XBGR8888_SNORM,    /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
+   MESA_FORMAT_XBGR8888_SRGB,     /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
+   MESA_FORMAT_XBGR8888_UINT,     /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
+   MESA_FORMAT_XBGR8888_SINT,     /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
+   MESA_FORMAT_XRGB2101010_UNORM, /* xxRR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */
+   MESA_FORMAT_XBGR16161616_UNORM,/* ushort[3]=x, [2]=B, [1]=G, [0]=R */
+   MESA_FORMAT_XBGR16161616_SNORM,/* ... */
+   MESA_FORMAT_XBGR16161616_FLOAT,/* ... */
+   MESA_FORMAT_XBGR16161616_UINT, /* ... */
+   MESA_FORMAT_XBGR16161616_SINT, /* ... */
+   MESA_FORMAT_XBGR32323232_FLOAT,/* float[3]=x, [2]=B, [1]=G, [0]=R */
+   MESA_FORMAT_XBGR32323232_UINT, /* ... */
+   MESA_FORMAT_XBGR32323232_SINT, /* ... */
 
    MESA_FORMAT_COUNT
 } gl_format;