diff options
author | Roland Scheidegger <sroland@vmware.com> | 2010-03-30 01:33:28 +0200 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2010-03-30 01:33:28 +0200 |
commit | 4e9690f00ca67e42e31367c50f9c216ad10ef553 (patch) | |
tree | 312f0696dda3b20bcdc18f39408766dd7fe192fb /src/gallium/auxiliary/util/u_format_access.py | |
parent | 9de2ee646ad09676817c558a6d02f5b2bb7bb173 (diff) |
gallium: make the python scripts for format parsing not fail on new formats
they won't generate any useful conversion code for some of the new formats
but at least don't assert. Also needed some more hacks so they don't generate
code for some of the new formats, as gcc was not impressed.
Also declare unused channels as void, and change the scripts to not fail if
the first channel happened to be unused.
Needs serious fixing.
Diffstat (limited to 'src/gallium/auxiliary/util/u_format_access.py')
-rw-r--r-- | src/gallium/auxiliary/util/u_format_access.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py index 00424779d2..42a37badca 100644 --- a/src/gallium/auxiliary/util/u_format_access.py +++ b/src/gallium/auxiliary/util/u_format_access.py @@ -60,6 +60,9 @@ def is_format_supported(format): channel = format.channels[i] if channel.type not in (VOID, UNSIGNED, FLOAT): return False + if channel.type == FLOAT: + if channel.size not in (32, 64) or format.is_mixed(): + 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: @@ -78,6 +81,8 @@ def native_type(format): else: # For array pixel formats return the integer type that matches the color channel channel = format.channels[0] + if channel.type == VOID: + channel = format.channels[1] if channel.type == UNSIGNED: return 'uint%u_t' % channel.size elif channel.type == SIGNED: |