aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_format_parse.py
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-06-28 16:49:07 +0200
committermarha <marha@users.sourceforge.net>2013-06-28 16:49:07 +0200
commit3c204c4a20943586532ce477ced827d108f3b4b0 (patch)
treec9891fdc315c41cc90806634589231172572b2ba /mesalib/src/gallium/auxiliary/util/u_format_parse.py
parent73a26452133415b7e3bf54836d23995d59a7bac4 (diff)
parentced1a6b8f5a750fcd3b8d3d0d9bbdee830064e6c (diff)
downloadvcxsrv-3c204c4a20943586532ce477ced827d108f3b4b0.tar.gz
vcxsrv-3c204c4a20943586532ce477ced827d108f3b4b0.tar.bz2
vcxsrv-3c204c4a20943586532ce477ced827d108f3b4b0.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig mesa git update 28 June 2013 libXext mesa git update 29 June 20013
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