mesa: Add gl_MESAFogParamsOptimized for our special pre-computed fog params.
[mesa.git] / src / glsl / ir_hierarchical_visitor.h
index 8b9e49dab13b707a0c1ad55f251687876446eddf..dc177f5eb0ddb1a2c19bf5eb15532567719b9d3d 100644 (file)
@@ -129,6 +129,8 @@ public:
    virtual ir_visitor_status visit_leave(class ir_call *);
    virtual ir_visitor_status visit_enter(class ir_return *);
    virtual ir_visitor_status visit_leave(class ir_return *);
+   virtual ir_visitor_status visit_enter(class ir_discard *);
+   virtual ir_visitor_status visit_leave(class ir_discard *);
    virtual ir_visitor_status visit_enter(class ir_if *);
    virtual ir_visitor_status visit_leave(class ir_if *);
    /*@}*/
@@ -139,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.
     *
@@ -153,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 */