inv_swizzles is used in lp_tile_soa.py to create lp_tile_soa.c, we overwrite swizzles if they are already set.
This results in the i8 format getting alpha instead of red, and the l8 format
getting blue instead of red.
Fixes fbo-alphatest-formats, fbo-alphatest-formats ARB_texture_float,
and fbo-alphatest-formats EXT_texture_snorm on llvmpipe.
Signed-off-by: Dave Airlie <airlied@redhat.com>
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