summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_hierarchical_visitor.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-07-01 10:09:58 -0700
committerEric Anholt <[email protected]>2010-07-01 11:07:23 -0700
commit8a1f186cc55979bb9df0a88b48da8d81460c3e7c (patch)
tree7a39126f77b75f94c09f441fdbca6c2be57d34cb /src/glsl/ir_hierarchical_visitor.h
parent9acf618f24428eba72650c0e328e7ed52986728e (diff)
glsl2: Add a pass to convert mod(a, b) to b * fract(a/b).
This is used by the Mesa IR backend to implement mod, fixing glsl-fs-mod.
Diffstat (limited to 'src/glsl/ir_hierarchical_visitor.h')
-rw-r--r--src/glsl/ir_hierarchical_visitor.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/glsl/ir_hierarchical_visitor.h b/src/glsl/ir_hierarchical_visitor.h
index 2c4590d4b10..afa780dc912 100644
--- a/src/glsl/ir_hierarchical_visitor.h
+++ b/src/glsl/ir_hierarchical_visitor.h
@@ -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.
*
@@ -161,4 +171,6 @@ 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 */