summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-08-25 13:38:43 +0100
committerDave Airlie <airlied@redhat.com>2011-08-25 16:54:20 +0100
commit5f3de17ef0f8b6280a6bf331ea6686a260f0d0d4 (patch)
treec50c18223afcb45a2458f97cededea76fe9b182e
parent62ad6e66a5c11fa58e51a6251f97a12a759773ec (diff)
glsl_to_tgsi: add TXF support. (v2)
This adds texelFetch support to translate from GLSL to TGSI TXF opcode. I've tested this works with an r600g and softpipe backend. v2: drop comments, fix title, Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Bryan Cain <bryancain3@gmail.com>
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 85e4c662fe..9cac30995a 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2476,8 +2476,10 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
ir->lod_info.lod->accept(this);
lod_info = this->result;
break;
- case ir_txf: /* TODO: use TGSI_OPCODE_TXF here */
- assert(!"GLSL 1.30 features unsupported");
+ case ir_txf:
+ opcode = TGSI_OPCODE_TXF;
+ ir->lod_info.lod->accept(this);
+ lod_info = this->result;
break;
}
@@ -2541,7 +2543,8 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
coord_dst.writemask = WRITEMASK_XYZW;
}
- if (opcode == TGSI_OPCODE_TXL || opcode == TGSI_OPCODE_TXB) {
+ if (opcode == TGSI_OPCODE_TXL || opcode == TGSI_OPCODE_TXB ||
+ opcode == TGSI_OPCODE_TXF) {
/* TGSI stores LOD or LOD bias in the last channel of the coords. */
coord_dst.writemask = WRITEMASK_W;
emit(ir, TGSI_OPCODE_MOV, coord_dst, lod_info);
@@ -4285,6 +4288,7 @@ compile_tgsi_instruction(struct st_translate *t,
case TGSI_OPCODE_TXL:
case TGSI_OPCODE_TXP:
case TGSI_OPCODE_TXQ:
+ case TGSI_OPCODE_TXF:
src[num_src++] = t->samplers[inst->sampler];
ureg_tex_insn(ureg,
inst->op,