summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_rvalue_visitor.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-07-20 14:10:44 -0700
committerEric Anholt <[email protected]>2012-08-07 11:47:49 -0700
commit8c2a9838355cfd02356bf7b22eead408d909fe25 (patch)
tree28707560639b80ee8e0696eb829d375073920554 /src/glsl/ir_rvalue_visitor.h
parent2ea3ab14f2182978f471674c9dfce029d37f70a7 (diff)
glsl: Add a variant of the rvalue visitor for handle_rvalue() on the way down.
For the UBO lowering pass, I want to see the whole dereference chain for replacing, not the innermost ir_dereference_variable. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ir_rvalue_visitor.h')
-rw-r--r--src/glsl/ir_rvalue_visitor.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/glsl/ir_rvalue_visitor.h b/src/glsl/ir_rvalue_visitor.h
index 31a56beb9b8..2179fa5a8f7 100644
--- a/src/glsl/ir_rvalue_visitor.h
+++ b/src/glsl/ir_rvalue_visitor.h
@@ -30,7 +30,22 @@
* a pointer to each rvalue in the tree.
*/
-class ir_rvalue_visitor : public ir_hierarchical_visitor {
+class ir_rvalue_base_visitor : public ir_hierarchical_visitor {
+public:
+ ir_visitor_status rvalue_visit(ir_assignment *);
+ ir_visitor_status rvalue_visit(ir_call *);
+ ir_visitor_status rvalue_visit(ir_dereference_array *);
+ ir_visitor_status rvalue_visit(ir_dereference_record *);
+ ir_visitor_status rvalue_visit(ir_expression *);
+ ir_visitor_status rvalue_visit(ir_if *);
+ ir_visitor_status rvalue_visit(ir_return *);
+ ir_visitor_status rvalue_visit(ir_swizzle *);
+ ir_visitor_status rvalue_visit(ir_texture *);
+
+ virtual void handle_rvalue(ir_rvalue **rvalue) = 0;
+};
+
+class ir_rvalue_visitor : public ir_rvalue_base_visitor {
public:
virtual ir_visitor_status visit_leave(ir_assignment *);
@@ -42,6 +57,18 @@ public:
virtual ir_visitor_status visit_leave(ir_return *);
virtual ir_visitor_status visit_leave(ir_swizzle *);
virtual ir_visitor_status visit_leave(ir_texture *);
+};
- virtual void handle_rvalue(ir_rvalue **rvalue) = 0;
+class ir_rvalue_enter_visitor : public ir_rvalue_base_visitor {
+public:
+
+ virtual ir_visitor_status visit_enter(ir_assignment *);
+ virtual ir_visitor_status visit_enter(ir_call *);
+ virtual ir_visitor_status visit_enter(ir_dereference_array *);
+ virtual ir_visitor_status visit_enter(ir_dereference_record *);
+ virtual ir_visitor_status visit_enter(ir_expression *);
+ virtual ir_visitor_status visit_enter(ir_if *);
+ virtual ir_visitor_status visit_enter(ir_return *);
+ virtual ir_visitor_status visit_enter(ir_swizzle *);
+ virtual ir_visitor_status visit_enter(ir_texture *);
};