diff options
-rw-r--r-- | src/amd/vulkan/vk_format_parse.py | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_format_parse.py | 6 | ||||
-rw-r--r-- | src/mesa/main/format_parser.py | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/amd/vulkan/vk_format_parse.py b/src/amd/vulkan/vk_format_parse.py index 00cf1adf5a7..ba730388a7b 100644 --- a/src/amd/vulkan/vk_format_parse.py +++ b/src/amd/vulkan/vk_format_parse.py @@ -73,8 +73,14 @@ class Channel: return s def __eq__(self, other): + if other is None: + return False + return self.type == other.type and self.norm == other.norm and self.pure == other.pure and self.size == other.size and self.scaled == other.scaled + def __ne__(self, other): + return not self == other + def max(self): '''Maximum representable number.''' if self.type == FLOAT: diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index d3874cd895b..48cc012cd2a 100644 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -72,8 +72,14 @@ class Channel: return s def __eq__(self, other): + if other is None: + return False + return self.type == other.type and self.norm == other.norm and self.pure == other.pure and self.size == other.size + def __ne__(self, other): + return not self == other + def max(self): '''Maximum representable number.''' if self.type == FLOAT: diff --git a/src/mesa/main/format_parser.py b/src/mesa/main/format_parser.py index 3321ad33ffa..c0d73c9d22e 100644 --- a/src/mesa/main/format_parser.py +++ b/src/mesa/main/format_parser.py @@ -61,8 +61,14 @@ class Channel: return s def __eq__(self, other): + if other is None: + return False + return self.type == other.type and self.norm == other.norm and self.size == other.size + def __ne__(self, other): + return not self.__eq__(other) + def max(self): """Returns the maximum representable number.""" if self.type == FLOAT: |