diff options
author | Roland Scheidegger <sroland@vmware.com> | 2010-03-31 16:57:05 +0200 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2010-03-31 16:57:05 +0200 |
commit | d97f6963aee71d8fafa2a94a5fe1f3ca4b4ef16d (patch) | |
tree | 4b6fa4c2104dae852616908923d00b723cca082c /src/gallium/auxiliary/util/u_format_pack.py | |
parent | 96bf4aff5bd674bba5d83ab32c46024a686c1a1d (diff) | |
parent | 56b34e54f29cdd0a479219695c6559c44a41a76c (diff) |
Merge branch 'gallium-new-formats'
Conflicts:
src/gallium/auxiliary/util/u_format.csv
src/gallium/auxiliary/util/u_format_access.py
src/gallium/auxiliary/util/u_format_pack.py
Diffstat (limited to 'src/gallium/auxiliary/util/u_format_pack.py')
-rw-r--r-- | src/gallium/auxiliary/util/u_format_pack.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py index 28a9dad60e..f40b3bdf2e 100644 --- a/src/gallium/auxiliary/util/u_format_pack.py +++ b/src/gallium/auxiliary/util/u_format_pack.py @@ -46,11 +46,11 @@ def generate_format_type(format): '''Generate a structure that describes the format.''' print 'union util_format_%s {' % format.short_name() - if format.is_bitmask(): + if format.is_bitmask() or format.short_name() == "r11g11b10_float": print ' uint%u_t value;' % (format.block_size(),) print ' struct {' for channel in format.channels: - if format.is_bitmask() and not format.is_array(): + if (format.is_bitmask() or format.is_mixed()) and not format.is_array() or format.short_name() == "r11g11b10_float": if channel.type == VOID: if channel.size: print ' unsigned %s:%u;' % (channel.name, channel.size) @@ -58,6 +58,11 @@ def generate_format_type(format): print ' unsigned %s:%u;' % (channel.name, channel.size) elif channel.type == SIGNED: print ' int %s:%u;' % (channel.name, channel.size) + elif channel.type == FLOAT: + if channel.size == 32: + print ' float %s;' % (channel.name) + else: + print ' unsigned %s:%u;' % (channel.name, channel.size) else: assert 0 else: @@ -107,6 +112,9 @@ def is_format_supported(format): channel = format.channels[i] if channel.type not in (VOID, UNSIGNED, SIGNED, FLOAT): return False + if channel.type == FLOAT: + if channel.size not in (32, 64): + return False # We can only read a color from a depth/stencil format if the depth channel is present if format.colorspace == 'zs' and format.swizzles[0] == SWIZZLE_NONE: |