From be298063b501a3e0bd769209f531fd23e4e4646e Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 26 May 2010 15:15:31 -0700 Subject: [PATCH] ir_print_visitor: Add support for ir_texture. --- ir_print_visitor.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++++ ir_print_visitor.h | 1 + 2 files changed, 50 insertions(+) diff --git a/ir_print_visitor.cpp b/ir_print_visitor.cpp index 84edad5dfac..18ff48c3b34 100644 --- a/ir_print_visitor.cpp +++ b/ir_print_visitor.cpp @@ -143,6 +143,55 @@ void ir_print_visitor::visit(ir_expression *ir) } +void ir_print_visitor::visit(ir_texture *ir) +{ + printf("(%s ", ir->opcode_string()); + + ir->sampler->accept(this); + printf(" "); + + ir->coordinate->accept(this); + + printf(" (%d %d %d) ", ir->offsets[0], ir->offsets[1], ir->offsets[2]); + + if (ir->op != ir_txf) { + if (ir->projector) + ir->projector->accept(this); + else + printf("1"); + + if (ir->shadow_comparitor) { + printf(" "); + ir->shadow_comparitor->accept(this); + } else { + printf(" ()"); + } + } + + printf(" "); + switch (ir->op) + { + case ir_tex: + break; + case ir_txb: + ir->lod_info.bias->accept(this); + break; + case ir_txl: + case ir_txf: + ir->lod_info.lod->accept(this); + break; + case ir_txd: + printf("("); + ir->lod_info.grad.dPdx->accept(this); + printf(" "); + ir->lod_info.grad.dPdy->accept(this); + printf(")"); + break; + }; + printf(")"); +} + + void ir_print_visitor::visit(ir_swizzle *ir) { const unsigned swiz[4] = { diff --git a/ir_print_visitor.h b/ir_print_visitor.h index 4af508794bd..e97b823522a 100644 --- a/ir_print_visitor.h +++ b/ir_print_visitor.h @@ -60,6 +60,7 @@ public: virtual void visit(ir_function_signature *); virtual void visit(ir_function *); virtual void visit(ir_expression *); + virtual void visit(ir_texture *); virtual void visit(ir_swizzle *); virtual void visit(ir_dereference_variable *); virtual void visit(ir_dereference_array *); -- 2.30.2