aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_format_parse.py
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-06-26 15:01:24 +0200
committermarha <marha@users.sourceforge.net>2013-06-26 15:01:24 +0200
commit2fe2056807d1304de86deb2b59992d51d9252ad0 (patch)
tree665d730ee19df03e4dfca01371009ec778a343af /mesalib/src/gallium/auxiliary/util/u_format_parse.py
parentfa791414601df61d20d860299dba80fdb62565df (diff)
downloadvcxsrv-2fe2056807d1304de86deb2b59992d51d9252ad0.tar.gz
vcxsrv-2fe2056807d1304de86deb2b59992d51d9252ad0.tar.bz2
vcxsrv-2fe2056807d1304de86deb2b59992d51d9252ad0.zip
libXext mesa git update 29 June 20013
libXext commit 7378d4bdbd33ed49ed6cfa5c4f73d7527982aab4 mesa commit 9aebad618c0aab527a0b838ce0a79ffa6dd426bb
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_format_parse.py')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_format_parse.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_format_parse.py b/mesalib/src/gallium/auxiliary/util/u_format_parse.py
index 07052b996..e202099b9 100644
--- a/mesalib/src/gallium/auxiliary/util/u_format_parse.py
+++ b/mesalib/src/gallium/auxiliary/util/u_format_parse.py
@@ -30,6 +30,8 @@
'''
+import sys
+
VOID, UNSIGNED, SIGNED, FIXED, FLOAT = range(5)
SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W, SWIZZLE_0, SWIZZLE_1, SWIZZLE_NONE, = range(7)
@@ -42,6 +44,9 @@ YUV = 'yuv'
ZS = 'zs'
+# Not cross-compiler friendly
+is_big_endian = sys.byteorder == 'big'
+
def is_pot(x):
return (x & (x - 1)) == 0
@@ -307,6 +312,11 @@ def parse(filename):
channel = Channel(type, norm, pure, size, names[i])
channels.append(channel)
+ shift = 0
+ for channel in channels[3::-1] if is_big_endian else channels:
+ channel.shift = shift
+ shift += channel.size
+
format = Format(name, layout, block_width, block_height, channels, swizzles, colorspace)
formats.append(format)
return formats