Hook up texturing in the hierarchical visitor.
authorEric Anholt <eric@anholt.net>
Tue, 22 Jun 2010 17:45:15 +0000 (10:45 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 23 Jun 2010 01:18:30 +0000 (18:18 -0700)
ir_hv_accept.cpp

index 54326332724387ad8bfc67f0ea319fb93a5bbb39..f936b3500ebd719596861e20b6a73c9f600bff16 100644 (file)
@@ -159,6 +159,55 @@ done:
 ir_visitor_status
 ir_texture::accept(ir_hierarchical_visitor *v)
 {
+   ir_visitor_status s = v->visit_enter(this);
+   if (s != visit_continue)
+      return (s == visit_continue_with_parent) ? visit_continue : s;
+
+   s = this->sampler->accept(v);
+   if (s != visit_continue)
+      return (s == visit_continue_with_parent) ? visit_continue : s;
+
+   s = this->coordinate->accept(v);
+   if (s != visit_continue)
+      return (s == visit_continue_with_parent) ? visit_continue : s;
+
+   if (this->projector) {
+      s = this->projector->accept(v);
+      if (s != visit_continue)
+        return (s == visit_continue_with_parent) ? visit_continue : s;
+   }
+
+   if (this->shadow_comparitor) {
+      s = this->shadow_comparitor->accept(v);
+      if (s != visit_continue)
+        return (s == visit_continue_with_parent) ? visit_continue : s;
+   }
+
+   switch (this->op) {
+   case ir_tex:
+      break;
+   case ir_txb:
+      s = this->lod_info.bias->accept(v);
+      if (s != visit_continue)
+        return (s == visit_continue_with_parent) ? visit_continue : s;
+      break;
+   case ir_txl:
+   case ir_txf:
+      s = this->lod_info.lod->accept(v);
+      if (s != visit_continue)
+        return (s == visit_continue_with_parent) ? visit_continue : s;
+      break;
+   case ir_txd:
+      s = this->lod_info.grad.dPdx->accept(v);
+      if (s != visit_continue)
+        return (s == visit_continue_with_parent) ? visit_continue : s;
+
+      s = this->lod_info.grad.dPdy->accept(v);
+      if (s != visit_continue)
+        return (s == visit_continue_with_parent) ? visit_continue : s;
+      break;
+   }
+
    return visit_continue_with_parent;
 }