summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2008-05-25 19:53:48 -0700
committerCorbin Simpson <MostAwesomeDude@gmail.com>2008-05-25 19:53:48 -0700
commit27d8fcd506942b115e480cfe9ca811194736579a (patch)
treecc59fd3cfa3fa708dfa6f604ec901e2fb32c2c83
parentf776f693c0aca4d01cc2bfdaedbb527062189e6d (diff)
r5xx: Unbreak texture swizzling.
-rw-r--r--src/mesa/drivers/dri/r300/r500_fragprog.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c
index 832763c554..5abb6e7399 100644
--- a/src/mesa/drivers/dri/r300/r500_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r500_fragprog.c
@@ -143,12 +143,11 @@ static inline GLuint make_sop_swizzle(struct prog_src_register src) {
}
static inline GLuint make_strq_swizzle(struct prog_src_register src) {
- GLuint swiz = 0x0;
- GLuint temp = src.Swizzle;
+ GLuint swiz = 0x0, temp = 0x0;
int i;
for (i = 0; i < 4; i++) {
- swiz += (temp & 0x3) << i*2;
- temp >>= 3;
+ temp = GET_SWZ(src.Swizzle, i) & 0x3;
+ swiz |= temp << i*2;
}
return swiz;
}
@@ -287,9 +286,9 @@ static void emit_tex(struct r500_fragment_program *fp,
}
fp->inst[counter].inst2 = R500_TEX_SRC_ADDR(hwsrc)
- /* | MAKE_SWIZ_TEX_STRQ(make_strq_swizzle(fpi->SrcReg[0])) */
- | R500_TEX_SRC_S_SWIZ_R | R500_TEX_SRC_T_SWIZ_G
- | R500_TEX_SRC_R_SWIZ_B | R500_TEX_SRC_Q_SWIZ_A
+ | MAKE_SWIZ_TEX_STRQ(make_strq_swizzle(fpi->SrcReg[0]))
+ /* | R500_TEX_SRC_S_SWIZ_R | R500_TEX_SRC_T_SWIZ_G
+ | R500_TEX_SRC_R_SWIZ_B | R500_TEX_SRC_Q_SWIZ_A */
| R500_TEX_DST_ADDR(hwdest)
| R500_TEX_DST_R_SWIZ_R | R500_TEX_DST_G_SWIZ_G
| R500_TEX_DST_B_SWIZ_B | R500_TEX_DST_A_SWIZ_A;