diff options
author | Marek Olšák <[email protected]> | 2011-05-06 21:59:51 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-05-07 02:51:38 +0200 |
commit | 03615c02d81437cf546609fc6a39c6c73be39360 (patch) | |
tree | 07a99b61d30c69f04a30d3efffede63d49ed3e1e /src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c | |
parent | d8e222d8877cf8b236bb24eb520521ff2e2ce32f (diff) |
r300/compiler: implement TXD and TXL opcodes
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index 5f2588bdfe5..c30cd753d15 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -396,6 +396,12 @@ static int emit_tex(struct r300_fragment_program_compiler *c, struct rc_sub_inst case RC_OPCODE_TXP: code->inst[ip].inst1 |= R500_TEX_INST_PROJ; break; + case RC_OPCODE_TXD: + code->inst[ip].inst1 |= R500_TEX_INST_DXDY; + break; + case RC_OPCODE_TXL: + code->inst[ip].inst1 |= R500_TEX_INST_LOD; + break; default: error("emit_tex can't handle opcode %s\n", rc_get_opcode_info(inst->Opcode)->Name); } @@ -413,6 +419,18 @@ static int emit_tex(struct r300_fragment_program_compiler *c, struct rc_sub_inst | (GET_SWZ(inst->TexSwizzle, 3) << 30) ; + if (inst->Opcode == RC_OPCODE_TXD) { + use_temporary(code, inst->SrcReg[1].Index); + use_temporary(code, inst->SrcReg[2].Index); + + /* DX and DY parameters are specified in a separate register. */ + code->inst[ip].inst3 = + R500_DX_ADDR(inst->SrcReg[1].Index) | + (translate_strq_swizzle(inst->SrcReg[1].Swizzle) << 8) | + R500_DY_ADDR(inst->SrcReg[2].Index) | + (translate_strq_swizzle(inst->SrcReg[2].Swizzle) << 24); + } + return 1; } |