diff options
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: |