michal wrote on 2010-01-06 07:58:
michal wrote on 2009-12-22 10:00:
Marek Olšák wrote on 2009-12-22 08:40:
Hi,
I noticed that gallium/auxiliary/util/u_format.csv contains some weird
swizzling, for example see this:
$ grep zyxw u_format.csv
PIPE_FORMAT_A8R8G8B8_UNORM , arith , 1, 1, un8 , un8 , un8 ,
un8 , zyxw, rgb
PIPE_FORMAT_A1R5G5B5_UNORM , arith , 1, 1, un5 , un5 , un5 ,
un1 , zyxw, rgb
PIPE_FORMAT_A4R4G4B4_UNORM , arith , 1, 1, un4 , un4 , un4 ,
un4 , zyxw, rgb
PIPE_FORMAT_A8B8G8R8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 ,
sn8 , zyxw, rgb
PIPE_FORMAT_B8G8R8A8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8
, zyxw, srgb
It's hard to believe that ARGB, ABGR, and BGRA have the same
swizzling. Let's continue our journey:
$ grep A8R8G8B8 u_format.csv
PIPE_FORMAT_A8R8G8B8_UNORM , arith , 1, 1, un8 , un8 , un8 ,
un8 , zyxw, rgb
PIPE_FORMAT_A8R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 ,
u8 , wxyz, srgb
Same formats, different swizzling? Also:
$ grep B8G8R8A8 u_format.csv
PIPE_FORMAT_B8G8R8A8_UNORM , arith , 1, 1, un8 , un8 , un8 ,
un8 , yzwx, rgb
PIPE_FORMAT_B8G8R8A8_SRGB , arith , 1, 1, u8 , u8 , u8 ,
u8 , zyxw, srgb
Same formats, different swizzling? I don't really get it. And there's
much more cases like these. Could someone tell me what the intended
order of channels should be? (or possibly propose a fix) The meaning
of the whole table is self-contradictory and it's definitely the
source of some r300g bugs.
Marek,
Yes, that seems like a defect. The format swizzle field tells us how to
"swizzle" the incoming pixel so that its components are ordered in some
predefined order. For RGB and SRGB colorspaces the order is R, G, B and
A. For depth-stencil, ie. ZS color space the order is Z and then S.
I will have a look at this.
Marek, Jose,
Can you review the attached patch?
Ouch, it looks like we will have to leave 24-bit (s)rgb formats with
array layout as the current code generator will bite us on big endian
platforms. Attached an updated patch.
>From b906e38badecffeacdda6fda04fd0456ebd21510 Mon Sep 17 00:00:00 2001
From: Michal Krol <mic...@vmware.com>
Date: Wed, 6 Jan 2010 08:36:00 +0100
Subject: [PATCH] util: Fix format descriptor table entries.
For 8-/16-/32-bit-sized srgb/rgb formats, make them have an arith layout
and their components read from right to left.
Not sure about dxt layout, though.
---
src/gallium/auxiliary/util/u_format.csv | 54 +++++++++++++++---------------
1 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_format.csv
b/src/gallium/auxiliary/util/u_format.csv
index 866b18f..e37c446 100644
--- a/src/gallium/auxiliary/util/u_format.csv
+++ b/src/gallium/auxiliary/util/u_format.csv
@@ -61,43 +61,43 @@ PIPE_FORMAT_R16_SSCALED , array , 1, 1, s16 ,
, , , x001,
PIPE_FORMAT_R16G16_SSCALED , array , 1, 1, s16 , s16 , , ,
xy01, rgb
PIPE_FORMAT_R16G16B16_SSCALED , array , 1, 1, s16 , s16 , s16 , ,
xyz1, rgb
PIPE_FORMAT_R16G16B16A16_SSCALED , array , 1, 1, s16 , s16 , s16 , s16 ,
xyzw, rgb
-PIPE_FORMAT_R8_UNORM , array , 1, 1, un8 , , , ,
x001, rgb
-PIPE_FORMAT_R8G8_UNORM , array , 1, 1, un8 , un8 , , ,
xy01, rgb
+PIPE_FORMAT_R8_UNORM , arith , 1, 1, un8 , , , ,
x001, rgb
+PIPE_FORMAT_R8G8_UNORM , arith , 1, 1, un8 , un8 , , ,
yx01, rgb
PIPE_FORMAT_R8G8B8_UNORM , array , 1, 1, un8 , un8 , un8 , ,
xyz1, rgb
-PIPE_FORMAT_R8G8B8A8_UNORM , array , 1, 1, un8 , un8 , un8 , un8 ,
xyzw, rgb
-PIPE_FORMAT_R8G8B8X8_UNORM , array , 1, 1, un8 , un8 , un8 , un8 ,
xyz1, rgb
-PIPE_FORMAT_R8_USCALED , array , 1, 1, u8 , , , ,
x001, rgb
-PIPE_FORMAT_R8G8_USCALED , array , 1, 1, u8 , u8 , , ,
xy01, rgb
+PIPE_FORMAT_R8G8B8A8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 ,
wzyx, rgb
+PIPE_FORMAT_R8G8B8X8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 ,
wzy1, rgb
+PIPE_FORMAT_R8_USCALED , arith , 1, 1, u8 , , , ,
x001, rgb
+PIPE_FORMAT_R8G8_USCALED , arith , 1, 1, u8 , u8 , , ,
yx01, rgb
PIPE_FORMAT_R8G8B8_USCALED , array , 1, 1, u8 , u8 , u8 , ,
xyz1, rgb
-PIPE_FORMAT_R8G8B8A8_USCALED , array , 1, 1, u8 , u8 , u8 , u8 ,
xyzw, rgb
-PIPE_FORMAT_R8G8B8X8_USCALED , array , 1, 1, u8 , u8 , u8 , u8 ,
xyz1, rgb
-PIPE_FORMAT_R8_SNORM , array , 1, 1, sn8 , , , ,
x001, rgb
-PIPE_FORMAT_R8G8_SNORM , array , 1, 1, sn8 , sn8 , , ,
xy01, rgb
+PIPE_FORMAT_R8G8B8A8_USCALED , arith , 1, 1, u8 , u8 , u8 , u8 ,
wzyx, rgb
+PIPE_FORMAT_R8G8B8X8_USCALED , arith , 1, 1, u8 , u8 , u8 , u8 ,
wzy1, rgb
+PIPE_FORMAT_R8_SNORM , arith , 1, 1, sn8 , , , ,
x001, rgb
+PIPE_FORMAT_R8G8_SNORM , arith , 1, 1, sn8 , sn8 , , ,
yx01, rgb
PIPE_FORMAT_R8G8B8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , ,
xyz1, rgb
-PIPE_FORMAT_R8G8B8A8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 ,
xyzw, rgb
-PIPE_FORMAT_R8G8B8X8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 ,
xyz1, rgb
-PIPE_FORMAT_B6G5R5_SNORM , arith , 1, 1, sn5 , sn5 , sn6 , ,
zyx1, rgb
-PIPE_FORMAT_A8B8G8R8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 ,
zyxw, rgb
-PIPE_FORMAT_X8B8G8R8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 ,
zyx1, rgb
-PIPE_FORMAT_R8_SSCALED , array , 1, 1, s8 , , , ,
x001, rgb
-PIPE_FORMAT_R8G8_SSCALED , array , 1, 1, s8 , s8 , , ,
xy01, rgb
+PIPE_FORMAT_R8G8B8A8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 ,
wzyx, rgb
+PIPE_FORMAT_R8G8B8X8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 ,
wzy1, rgb
+PIPE_FORMAT_B6G5R5_SNORM , arith , 1, 1, sn5 , sn5 , sn6 , ,
xyz1, rgb
+PIPE_FORMAT_A8B8G8R8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 ,
xyzw, rgb
+PIPE_FORMAT_X8B8G8R8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 ,
xyz1, rgb
+PIPE_FORMAT_R8_SSCALED , arith , 1, 1, s8 , , , ,
x001, rgb
+PIPE_FORMAT_R8G8_SSCALED , arith , 1, 1, s8 , s8 , , ,
yx01, rgb
PIPE_FORMAT_R8G8B8_SSCALED , array , 1, 1, s8 , s8 , s8 , ,
xyz1, rgb
-PIPE_FORMAT_R8G8B8A8_SSCALED , array , 1, 1, s8 , s8 , s8 , s8 ,
xyzw, rgb
-PIPE_FORMAT_R8G8B8X8_SSCALED , array , 1, 1, s8 , s8 , s8 , s8 ,
xyz1, rgb
+PIPE_FORMAT_R8G8B8A8_SSCALED , arith , 1, 1, s8 , s8 , s8 , s8 ,
wzyx, rgb
+PIPE_FORMAT_R8G8B8X8_SSCALED , arith , 1, 1, s8 , s8 , s8 , s8 ,
wzy1, rgb
PIPE_FORMAT_R32_FIXED , array , 1, 1, h32 , , , ,
x001, rgb
PIPE_FORMAT_R32G32_FIXED , array , 1, 1, h32 , h32 , , ,
xy01, rgb
PIPE_FORMAT_R32G32B32_FIXED , array , 1, 1, h32 , h32 , h32 , ,
xyz1, rgb
PIPE_FORMAT_R32G32B32A32_FIXED , array , 1, 1, h32 , h32 , h32 , h32 ,
xyzw, rgb
PIPE_FORMAT_L8_SRGB , arith , 1, 1, u8 , , , ,
xxx1, srgb
PIPE_FORMAT_A8L8_SRGB , arith , 1, 1, u8 , u8 , , ,
xxxy, srgb
-PIPE_FORMAT_R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , ,
xyz1, srgb
-PIPE_FORMAT_R8G8B8A8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
xyzw, srgb
-PIPE_FORMAT_R8G8B8X8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
xyz1, srgb
-PIPE_FORMAT_A8R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
wxyz, srgb
-PIPE_FORMAT_X8R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
1xyz, srgb
-PIPE_FORMAT_B8G8R8A8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
zyxw, srgb
-PIPE_FORMAT_B8G8R8X8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
zyx1, srgb
-PIPE_FORMAT_X8UB8UG8SR8S_NORM , arith , 1, 1, sn8 , sn8 , un8 , x8 ,
1zyx, rgb
+PIPE_FORMAT_R8G8B8_SRGB , array , 1, 1, u8 , u8 , u8 , ,
xyz1, srgb
+PIPE_FORMAT_R8G8B8A8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
wzyx, srgb
+PIPE_FORMAT_R8G8B8X8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
wzy1, srgb
+PIPE_FORMAT_A8R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
zyxw, srgb
+PIPE_FORMAT_X8R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
zyx1, srgb
+PIPE_FORMAT_B8G8R8A8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
yzwx, srgb
+PIPE_FORMAT_B8G8R8X8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 ,
yzw1, srgb
+PIPE_FORMAT_X8UB8UG8SR8S_NORM , arith , 1, 1, sn8 , sn8 , un8 , x8 ,
xyz1, rgb
PIPE_FORMAT_B6UG5SR5S_NORM , arith , 1, 1, sn5 , sn5 , un6 , ,
xyz1, rgb
PIPE_FORMAT_DXT1_RGB , dxt , 4, 4, x64 , , , ,
xyz1, rgb
PIPE_FORMAT_DXT1_RGBA , dxt , 4, 4, x64 , , , ,
xyzw, rgb
--
1.6.4.msysgit.0
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev