summaryrefslogtreecommitdiffstats
path: root/ir_function_inlining.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-06-09 11:07:53 -0700
committerKenneth Graunke <[email protected]>2010-06-09 11:14:58 -0700
commitb97efa5db5fce2e0d9a4c61a939c85b240c89170 (patch)
tree0fad9e25c8b2a24fe33a4574e361bff3d1235acb /ir_function_inlining.cpp
parent8331d489487268cafb3248a598e409bff6b1b123 (diff)
ir_function_cloning_visitor: Add support for ir_texture.
Diffstat (limited to 'ir_function_inlining.cpp')
-rw-r--r--ir_function_inlining.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/ir_function_inlining.cpp b/ir_function_inlining.cpp
index d66eceedb86..a501c813fb8 100644
--- a/ir_function_inlining.cpp
+++ b/ir_function_inlining.cpp
@@ -201,8 +201,28 @@ ir_function_cloning_visitor::visit(ir_expression *ir)
void
ir_function_cloning_visitor::visit(ir_texture *ir)
{
- // FINISHME: Do stuff with texture lookups
- (void) ir;
+ ir_texture *tex = new ir_texture(ir->op);
+
+ ir->sampler->accept(this);
+ tex->set_sampler(this->result->as_dereference());
+
+ ir->coordinate->accept(this);
+ tex->coordinate = this->result->as_rvalue();
+
+ if (ir->projector != NULL) {
+ ir->projector->accept(this);
+ tex->projector = this->result->as_rvalue();
+ }
+
+ if (ir->shadow_comparitor != NULL) {
+ ir->shadow_comparitor->accept(this);
+ tex->shadow_comparitor = this->result->as_rvalue();
+ }
+
+ for (int i = 0; i < 3; i++)
+ tex->offsets[i] = ir->offsets[i];
+
+ tex->lod_info = ir->lod_info;
}