Mesa (master): i965: Fix glean/texSwizzle regression in previous commit.

Eric Anholt anholt at kemper.freedesktop.org
Sun Oct 3 07:25:54 UTC 2010


Module: Mesa
Branch: master
Commit: 14bf92ba19373d54e9909bbdda5e430e0affea37
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=14bf92ba19373d54e9909bbdda5e430e0affea37

Author: Eric Anholt <eric at anholt.net>
Date:   Sun Oct  3 00:24:09 2010 -0700

i965: Fix glean/texSwizzle regression in previous commit.

Easy enough patch, who needs a full test run.  Oh, that's right.  Me.

---

 src/mesa/drivers/dri/i965/brw_wm.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 6610640..2ea5967 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -342,6 +342,15 @@ static void brw_wm_populate_key( struct brw_context *brw,
       if (unit->_ReallyEnabled) {
          const struct gl_texture_object *t = unit->_Current;
          const struct gl_texture_image *img = t->Image[0][t->BaseLevel];
+	 int swizzles[SWIZZLE_NIL + 1] = {
+	    SWIZZLE_X,
+	    SWIZZLE_Y,
+	    SWIZZLE_Z,
+	    SWIZZLE_W,
+	    SWIZZLE_ZERO,
+	    SWIZZLE_ONE,
+	    SWIZZLE_NIL
+	 };
 
 	 key->tex_swizzles[i] = SWIZZLE_NOOP;
 
@@ -352,17 +361,11 @@ static void brw_wm_populate_key( struct brw_context *brw,
 	  */
 	 if (t->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) {
 	    if (t->DepthMode == GL_ALPHA) {
-	       key->tex_swizzles[i] =
-		  MAKE_SWIZZLE4(SWIZZLE_ZERO,
-				SWIZZLE_ZERO,
-				SWIZZLE_ZERO,
-				SWIZZLE_X);
+	       swizzles[0] = SWIZZLE_ZERO;
+	       swizzles[1] = SWIZZLE_ZERO;
+	       swizzles[2] = SWIZZLE_ZERO;
 	    } else if (t->DepthMode == GL_LUMINANCE) {
-	       key->tex_swizzles[i] =
-		  MAKE_SWIZZLE4(SWIZZLE_X,
-				SWIZZLE_X,
-				SWIZZLE_X,
-				SWIZZLE_ONE);
+	       swizzles[3] = SWIZZLE_ONE;
 	    }
 	 }
 
@@ -372,14 +375,11 @@ static void brw_wm_populate_key( struct brw_context *brw,
 		key->yuvtex_swap_mask |= 1 << i;
 	 }
 
-	 key->tex_swizzles[i] = MAKE_SWIZZLE4(GET_SWZ(key->tex_swizzles[i],
-						      GET_SWZ(t->_Swizzle, 0)),
-					      GET_SWZ(key->tex_swizzles[i],
-						      GET_SWZ(t->_Swizzle, 1)),
-					      GET_SWZ(key->tex_swizzles[i],
-						      GET_SWZ(t->_Swizzle, 2)),
-					      GET_SWZ(key->tex_swizzles[i],
-						      GET_SWZ(t->_Swizzle, 3)));
+	 key->tex_swizzles[i] =
+	    MAKE_SWIZZLE4(swizzles[GET_SWZ(t->_Swizzle, 0)],
+			  swizzles[GET_SWZ(t->_Swizzle, 1)],
+			  swizzles[GET_SWZ(t->_Swizzle, 2)],
+			  swizzles[GET_SWZ(t->_Swizzle, 3)]);
       }
       else {
          key->tex_swizzles[i] = SWIZZLE_NOOP;




More information about the mesa-commit mailing list