>
> was doing some piglit comparisons between softpipe and llvmpipe and
> noticed the fbo-alphatest-formats test fails on llvmpipe for all the
> I8 formats.
>
> Now I looked at the code generated for
> lp_tile_soa.c:lp_tile_i8_unorm_unswizzle_4ub and it references a[i+0]
> and a[i+1], if I change it to reference r[i + 0] and r[i + 1] the
> tests all pass, I suspect of course this code is reading off the end
> of the array for an I8_UNORM, but I'm not really sure what it expects
> to happen in this case.
>
> Maybe someone can take a look and let me know what the intentions were
> originally.
>

Okay this fixes it here, and even seems reasonable to me.

Dave.
From dc39b83df68e5128bfb585f9f9b5be6c9f5114ff Mon Sep 17 00:00:00 2001
From: Dave Airlie <airl...@gmail.com>
Date: Fri, 30 Dec 2011 10:52:16 +0000
Subject: [PATCH] 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 and this ends up with l8 getting the same inv_swizzle as a8, whereas with this patch its all correct.

Fixes fbo-alphatest-formats on llvmpipe.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 src/gallium/auxiliary/util/u_format_parse.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py
index 73a4bcb..ea649ca 100755
--- a/src/gallium/auxiliary/util/u_format_parse.py
+++ b/src/gallium/auxiliary/util/u_format_parse.py
@@ -199,7 +199,7 @@ class Format:
         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
 
-- 
1.7.7.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to