diff options
author | Cooper Yuan <cooperyuan@gmail.com> | 2009-07-14 10:39:07 +0800 |
---|---|---|
committer | Cooper Yuan <cooperyuan@gmail.com> | 2009-07-14 10:39:07 +0800 |
commit | f4646f3247b721d08a2e01da4b2c8a808663d765 (patch) | |
tree | 1ca9bf4529729abe45898a8cb151ad2f21ca4124 /src/mesa/drivers | |
parent | 37c0cde80aa99435c7b58b36e5e186782cff4e77 (diff) |
R6xx/r7xx: Fix specular lighting issue
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/r600/r700_assembler.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 4666518824..1d41c5cf78 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2883,14 +2883,17 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) return GL_FALSE; } - /* dst.z = log(src.y) */ + /* before: dst.w = log(src.y) + * after : dst.x = log(src.y) + * why change dest register is that dst.w has been initialized as 1 before + */ pAsm->D.dst.opcode = SQ_OP2_INST_LOG_CLAMPED; pAsm->D.dst.math = 1; pAsm->D.dst.rtype = dstType; pAsm->D.dst.reg = dstReg; - pAsm->D.dst.writex = 0; + pAsm->D.dst.writex = 1; pAsm->D.dst.writey = 0; - pAsm->D.dst.writez = 1; + pAsm->D.dst.writez = 0; pAsm->D.dst.writew = 0; pAsm->S[0].src.rtype = srcType; pAsm->S[0].src.reg = srcReg; @@ -2905,15 +2908,16 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) return GL_FALSE; } - /* dst.w = MUL_LIT(src.w, dst.z, src.x ) */ + /* before: tmp.x = amd MUL_LIT(src.w, dst.w, src.x ) */ + /* after : tmp.x = amd MUL_LIT(src.w, dst.x, src.x ) */ pAsm->D.dst.opcode = SQ_OP3_INST_MUL_LIT; pAsm->D.dst.op3 = 1; - pAsm->D.dst.rtype = dstType; - pAsm->D.dst.reg = dstReg; - pAsm->D.dst.writex = 0; + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writex = 1; pAsm->D.dst.writey = 0; pAsm->D.dst.writez = 0; - pAsm->D.dst.writew = 1; + pAsm->D.dst.writew = 0; pAsm->S[0].src.rtype = srcType; pAsm->S[0].src.reg = srcReg; @@ -2928,10 +2932,10 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) pAsm->S[1].src.reg = dstReg; setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); noneg_PVSSRC(&(pAsm->S[1].src)); - pAsm->S[1].src.swizzlex = SQ_SEL_Z; - pAsm->S[1].src.swizzley = SQ_SEL_Z; - pAsm->S[1].src.swizzlez = SQ_SEL_Z; - pAsm->S[1].src.swizzlew = SQ_SEL_Z; + pAsm->S[1].src.swizzlex = SQ_SEL_X; + pAsm->S[1].src.swizzley = SQ_SEL_X; + pAsm->S[1].src.swizzlez = SQ_SEL_X; + pAsm->S[1].src.swizzlew = SQ_SEL_X; pAsm->S[2].src.rtype = srcType; pAsm->S[2].src.reg = srcReg; @@ -2947,7 +2951,7 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) return GL_FALSE; } - /* dst.z = exp(dst.z) */ + /* dst.z = exp(tmp.x) */ pAsm->D.dst.opcode = SQ_OP2_INST_EXP_IEEE; pAsm->D.dst.math = 1; pAsm->D.dst.rtype = dstType; @@ -2957,14 +2961,14 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) pAsm->D.dst.writez = 1; pAsm->D.dst.writew = 0; - pAsm->S[0].src.rtype = dstType; - pAsm->S[0].src.reg = dstReg; + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); noneg_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[0].src.swizzlex = SQ_SEL_Z; - pAsm->S[0].src.swizzley = SQ_SEL_Z; - pAsm->S[0].src.swizzlez = SQ_SEL_Z; - pAsm->S[0].src.swizzlew = SQ_SEL_Z; + pAsm->S[0].src.swizzlex = SQ_SEL_X; + pAsm->S[0].src.swizzley = SQ_SEL_X; + pAsm->S[0].src.swizzlez = SQ_SEL_X; + pAsm->S[0].src.swizzlew = SQ_SEL_X; if( GL_FALSE == next_ins(pAsm) ) { |