Merge branch 'draw-instanced'
[mesa.git] / src / glsl / ir_hierarchical_visitor.h
index 2c4590d4b10de2f6f02e2d0a9ad5fbf1dde18ea9..dc177f5eb0ddb1a2c19bf5eb15532567719b9d3d 100644 (file)
@@ -141,6 +141,16 @@ public:
     */
    void run(struct exec_list *instructions);
 
+   /* Some visitors may need to insert new variable declarations and
+    * assignments for portions of a subtree, which means they need a
+    * pointer to the current instruction in the stream, not just their
+    * node in the tree rooted at that instruction.
+    *
+    * This is implemented by visit_list_elements -- if the visitor is
+    * not called by it, nothing good will happen.
+    */
+   class ir_instruction *base_ir;
+
    /**
     * Callback function that is invoked on entry to each node visited.
     *
@@ -155,10 +165,19 @@ public:
     * Extra data parameter passed to the per-node callback function
     */
    void *data;
+
+   /**
+    * Currently in the LHS of an assignment?
+    *
+    * This is set and cleared by the \c ir_assignment::accept method.
+    */
+   bool in_assignee;
 };
 
 void visit_tree(ir_instruction *ir,
                void (*callback)(class ir_instruction *ir, void *data),
                void *data);
 
+ir_visitor_status visit_list_elements(ir_hierarchical_visitor *v, exec_list *l);
+
 #endif /* IR_HIERARCHICAL_VISITOR_H */