summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2008-05-21 23:35:43 -0700
committerCorbin Simpson <[email protected]>2008-05-21 23:35:43 -0700
commit4f9dcdc35b277aa1ded60059a654da22d2075067 (patch)
tree9297db73fdf515728c1024ef7bcea6fbe47b8dcd /src
parent0dfbe9cdd7e076fb23d90e99e225fd0e19b63dfb (diff)
r5xx: Fixed LRP.
Works perfectly. It's a complex one, though, so it might fail in weird ways...
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r500_fragprog.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c
index f0c7fed7cbf..7bde21a61ed 100644
--- a/src/mesa/drivers/dri/r300/r500_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r500_fragprog.c
@@ -606,12 +606,14 @@ static GLboolean parse_program(struct r500_fragment_program *fp)
| R500_ALU_RGBA_ADDRD(dest);
break;
case OPCODE_LRP:
- /* src0 * src1 + INV(src0) * src2 */
+ /* src0 * src1 + INV(src0) * src2
+ * 1) MUL src0, src1, temp
+ * 2) PRE 1-src0; MAD srcp, src2, temp */
src[0] = make_src(fp, fpi->SrcReg[0]);
src[1] = make_src(fp, fpi->SrcReg[1]);
src[2] = make_src(fp, fpi->SrcReg[2]);
fp->inst[counter].inst0 = R500_INST_TYPE_ALU | R500_INST_TEX_SEM_WAIT
- | (R500_WRITEMASK_ARGB << 11);
+ | R500_INST_NOP | (R500_WRITEMASK_ARGB << 11);
fp->inst[counter].inst1 = R500_RGB_ADDR0(src[0])
| R500_RGB_ADDR1(src[1]);
fp->inst[counter].inst2 = R500_ALPHA_ADDR0(src[0])
@@ -630,10 +632,12 @@ static GLboolean parse_program(struct r500_fragment_program *fp)
counter++;
emit_alu(fp, counter, fpi);
fp->inst[counter].inst1 = R500_RGB_ADDR0(src[0])
- | R500_RGB_ADDR1(get_temp(fp, 0))
+ | R500_RGB_ADDR1(src[2])
+ | R500_RGB_ADDR2(get_temp(fp, 0))
| R500_RGB_SRCP_OP_1_MINUS_RGB0;
fp->inst[counter].inst2 = R500_ALPHA_ADDR0(src[0])
- | R500_ALPHA_ADDR1(get_temp(fp, 0))
+ | R500_ALPHA_ADDR1(src[2])
+ | R500_ALPHA_ADDR2(get_temp(fp, 0))
| R500_ALPHA_SRCP_OP_1_MINUS_A0;
fp->inst[counter].inst3 = R500_ALU_RGB_SEL_A_SRCP
| MAKE_SWIZ_RGB_A(make_rgb_swizzle(fpi->SrcReg[0]))
@@ -641,12 +645,12 @@ static GLboolean parse_program(struct r500_fragment_program *fp)
fp->inst[counter].inst4 = R500_ALPHA_OP_MAD
| R500_ALPHA_ADDRD(dest)
| R500_ALPHA_SEL_A_SRCP | MAKE_SWIZ_ALPHA_A(make_alpha_swizzle(fpi->SrcReg[0]))
- | R500_ALPHA_SEL_B_SRC1 | MAKE_SWIZ_ALPHA_B(make_alpha_swizzle(fpi->SrcReg[1]));
+ | R500_ALPHA_SEL_B_SRC1 | R500_ALPHA_SWIZ_B_A;
fp->inst[counter].inst5 = R500_ALU_RGBA_OP_MAD
| R500_ALU_RGBA_ADDRD(dest)
- | R500_ALU_RGBA_SEL_C_SRC0 | MAKE_SWIZ_RGBA_C(make_rgb_swizzle(fpi->SrcReg[0]))
- | R500_ALU_RGBA_ALPHA_SEL_C_SRC0
- | MAKE_SWIZ_ALPHA_C(make_alpha_swizzle(fpi->SrcReg[0]));
+ | R500_ALU_RGBA_SEL_C_SRC2 | MAKE_SWIZ_RGBA_C(make_rgb_swizzle(fpi->SrcReg[2]))
+ | R500_ALU_RGBA_ALPHA_SEL_C_SRC2
+ | MAKE_SWIZ_ALPHA_C(make_alpha_swizzle(fpi->SrcReg[2]));
break;
case OPCODE_MAD:
src[0] = make_src(fp, fpi->SrcReg[0]);