summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-10-03 00:24:09 -0700
committerEric Anholt <[email protected]>2010-10-03 00:24:09 -0700
commit14bf92ba19373d54e9909bbdda5e430e0affea37 (patch)
treea7e58779696580ee72ed7a70d822b78232926a1e
parenta7fa00dfc5ab5782b2e497fbf4ca292dde69cdbd (diff)
i965: Fix glean/texSwizzle regression in previous commit.
Easy enough patch, who needs a full test run. Oh, that's right. Me.
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c36
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 66106408c9e..2ea5967df12 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;