diff options
author | Dave Airlie <[email protected]> | 2011-12-30 10:52:16 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-12-30 13:43:52 +0000 |
commit | 4ca624f8e09bff1a4f681c54486e327605b8274d (patch) | |
tree | 345c877a0f0a6e985833fad44829e067f5b8f9e1 /src | |
parent | 7dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9 (diff) |
u_format: fix inv_swizzles generation
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 <[email protected]>
Diffstat (limited to 'src')
-rwxr-xr-x | src/gallium/auxiliary/util/u_format_parse.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 73a4bcb2100..3a39e5ba524 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/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 |