diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-04-07 22:16:18 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-04-07 22:16:18 +0100 |
commit | 2c06fa4682ec0dd8a9f9d15ace867a6b952fd2e8 (patch) | |
tree | d5802a9c133501edc2021aeaecd1dc14ea2f12f9 /src/gallium/auxiliary/util/u_format_parse.py | |
parent | 783e94243a46e5d11d9db51924839a1c64a281bc (diff) |
util: Support fixed formats conversion.
Diffstat (limited to 'src/gallium/auxiliary/util/u_format_parse.py')
-rwxr-xr-x | src/gallium/auxiliary/util/u_format_parse.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 03dc62d329..96e6451d0d 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -73,6 +73,8 @@ class Channel: '''Maximum representable number.''' if self.type == FLOAT: return VERY_LARGE + if self.type == FIXED: + return (1 << (self.size/2)) - 1 if self.norm: return 1 if self.type == UNSIGNED: @@ -85,6 +87,8 @@ class Channel: '''Minimum representable number.''' if self.type == FLOAT: return -VERY_LARGE + if self.type == FIXED: + return -(1 << (self.size/2)) if self.type == UNSIGNED: return 0 if self.norm: |