summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_format_access.py
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-02-26 15:45:48 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-02-26 16:46:34 +0000
commit4757325951e35460975e77d70dacf8b6eb10ab11 (patch)
tree0a40045d38001039bab42419faa805404776817f /src/gallium/auxiliary/util/u_format_access.py
parentfda9a19b3465e3eb6ef74611a85021055eb78a64 (diff)
util: Factor some code into u_format_parse.py
Diffstat (limited to 'src/gallium/auxiliary/util/u_format_access.py')
-rw-r--r--src/gallium/auxiliary/util/u_format_access.py20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py
index 267fb3fbbd..a7a91ea652 100644
--- a/src/gallium/auxiliary/util/u_format_access.py
+++ b/src/gallium/auxiliary/util/u_format_access.py
@@ -248,24 +248,6 @@ def conversion_expr(src_channel, dst_channel, dst_native_type, value):
assert False
-def compute_inverse_swizzle(format):
- '''Return an array[4] of inverse swizzle terms'''
- inv_swizzle = [None]*4
- if format.colorspace == 'rgb':
- for i in range(4):
- swizzle = format.swizzles[i]
- if swizzle < 4:
- inv_swizzle[swizzle] = i
- elif format.colorspace == 'zs':
- swizzle = format.swizzles[0]
- if swizzle < 4:
- inv_swizzle[swizzle] = 0
- else:
- assert False
-
- return inv_swizzle
-
-
def generate_format_read(format, dst_channel, dst_native_type, dst_suffix):
'''Generate the function to read pixels from a particular format'''
@@ -372,7 +354,7 @@ def generate_format_write(format, src_channel, src_native_type, src_suffix):
print ' const %s *src_pixel = src_row;' %src_native_type
print ' for (x = 0; x < w; ++x) {'
- inv_swizzle = compute_inverse_swizzle(format)
+ inv_swizzle = format.inv_swizzles()
if format.layout == PLAIN:
if not format.is_array():