From 2c06fa4682ec0dd8a9f9d15ace867a6b952fd2e8 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 7 Apr 2010 22:16:18 +0100 Subject: util: Support fixed formats conversion. --- src/gallium/auxiliary/util/u_format_parse.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/auxiliary/util/u_format_parse.py') 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: -- cgit v1.2.3