diff options
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/util/u_format_pack.py | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_format_parse.py | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py index 7a952a48b30..ad2e49281fb 100644 --- a/src/gallium/auxiliary/util/u_format_pack.py +++ b/src/gallium/auxiliary/util/u_format_pack.py @@ -36,7 +36,7 @@ ''' -from __future__ import print_function +from __future__ import division, print_function from u_format_parse import * @@ -240,7 +240,7 @@ def value_to_native(type, value): return truncate_mantissa(value, 23) return value if type.type == FIXED: - return int(value * (1 << (type.size/2))) + return int(value * (1 << (type.size // 2))) if not type.norm: return int(value) if type.type == UNSIGNED: diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index c0456f6d159..d3874cd895b 100644 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -29,6 +29,9 @@ ''' +from __future__ import division + + VOID, UNSIGNED, SIGNED, FIXED, FLOAT = range(5) SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W, SWIZZLE_0, SWIZZLE_1, SWIZZLE_NONE, = range(7) @@ -76,7 +79,7 @@ class Channel: if self.type == FLOAT: return VERY_LARGE if self.type == FIXED: - return (1 << (self.size/2)) - 1 + return (1 << (self.size // 2)) - 1 if self.norm: return 1 if self.type == UNSIGNED: @@ -90,7 +93,7 @@ class Channel: if self.type == FLOAT: return -VERY_LARGE if self.type == FIXED: - return -(1 << (self.size/2)) + return -(1 << (self.size // 2)) if self.type == UNSIGNED: return 0 if self.norm: |