summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_format_pack.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/util/u_format_pack.py')
-rw-r--r--src/gallium/auxiliary/util/u_format_pack.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py
index 409d024c63..e9d2573667 100644
--- a/src/gallium/auxiliary/util/u_format_pack.py
+++ b/src/gallium/auxiliary/util/u_format_pack.py
@@ -124,15 +124,15 @@ def native_type(format):
return 'uint%u_t' % format.block_size()
else:
# For array pixel formats return the integer type that matches the color channel
- type = format.channels[0]
- if type.type == UNSIGNED:
- return 'uint%u_t' % type.size
- elif type.type == SIGNED:
- return 'int%u_t' % type.size
- elif type.type == FLOAT:
- if type.size == 32:
+ channel = format.channels[0]
+ if channel.type in (UNSIGNED, VOID):
+ return 'uint%u_t' % channel.size
+ elif channel.type == SIGNED:
+ return 'int%u_t' % channel.size
+ elif channel.type == FLOAT:
+ if channel.size == 32:
return 'float'
- elif type.size == 64:
+ elif channel.size == 64:
return 'double'
else:
assert False