aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_format_parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_format_parse.py')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_format_parse.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_format_parse.py b/mesalib/src/gallium/auxiliary/util/u_format_parse.py
index 73a4bcb21..3a39e5ba5 100644
--- a/mesalib/src/gallium/auxiliary/util/u_format_parse.py
+++ b/mesalib/src/gallium/auxiliary/util/u_format_parse.py
@@ -196,10 +196,11 @@ class Format:
def inv_swizzles(self):
'''Return an array[4] of inverse swizzle terms'''
+ '''Only pick the first matching value to avoid l8 getting blue and i8 getting alpha'''
inv_swizzle = [None]*4
for i in range(4):
swizzle = self.swizzles[i]
- if swizzle < 4:
+ if swizzle < 4 and inv_swizzle[swizzle] == None:
inv_swizzle[swizzle] = i
return inv_swizzle