summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/ir_to_mesa.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2011-01-31 16:15:33 -0800
committerKenneth Graunke <[email protected]>2011-05-09 11:23:54 -0700
commit68074387a4af74e1b1b42908b23a4a7ca2c1efa4 (patch)
tree1dcc7d395aadfd945d06dff766cc6a64455dfed2 /src/mesa/program/ir_to_mesa.cpp
parent5a3a242a8fc4b9f0cac0e40786dd0c4831517473 (diff)
ir_to_mesa: Emit TXD instruction.
Mesa already supports this because of NV_fragment_program. Signed-off-by: Kenneth Graunke <[email protected]> Tested-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/program/ir_to_mesa.cpp')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index bc10b455b8b..510aeab82da 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -1966,7 +1966,7 @@ ir_to_mesa_visitor::visit(ir_call *ir)
void
ir_to_mesa_visitor::visit(ir_texture *ir)
{
- src_reg result_src, coord, lod_info, projector;
+ src_reg result_src, coord, lod_info, projector, dx, dy;
dst_reg result_dst, coord_dst;
ir_to_mesa_instruction *inst = NULL;
prog_opcode opcode = OPCODE_NOP;
@@ -2008,6 +2008,12 @@ ir_to_mesa_visitor::visit(ir_texture *ir)
lod_info = this->result;
break;
case ir_txd:
+ opcode = OPCODE_TXD;
+ ir->lod_info.grad.dPdx->accept(this);
+ dx = this->result;
+ ir->lod_info.grad.dPdy->accept(this);
+ dy = this->result;
+ break;
case ir_txf:
assert(!"GLSL 1.30 features unsupported");
break;
@@ -2080,7 +2086,10 @@ ir_to_mesa_visitor::visit(ir_texture *ir)
coord_dst.writemask = WRITEMASK_XYZW;
}
- inst = emit(ir, opcode, result_dst, coord);
+ if (opcode == OPCODE_TXD)
+ inst = emit(ir, opcode, result_dst, coord, dx, dy);
+ else
+ inst = emit(ir, opcode, result_dst, coord);
if (ir->shadow_comparitor)
inst->tex_shadow = GL_TRUE;