summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_rvalue_visitor.cpp
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.cpp
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.cpp')
-rw-r--r--src/glsl/ir_rvalue_visitor.cpp127
1 files changed, 118 insertions, 9 deletions
diff --git a/src/glsl/ir_rvalue_visitor.cpp b/src/glsl/ir_rvalue_visitor.cpp
index 193bcd2d7bd..b34a419e8e8 100644
--- a/src/glsl/ir_rvalue_visitor.cpp
+++ b/src/glsl/ir_rvalue_visitor.cpp
@@ -36,7 +36,7 @@
#include "glsl_types.h"
ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_expression *ir)
+ir_rvalue_base_visitor::rvalue_visit(ir_expression *ir)
{
unsigned int operand;
@@ -48,7 +48,7 @@ ir_rvalue_visitor::visit_leave(ir_expression *ir)
}
ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_texture *ir)
+ir_rvalue_base_visitor::rvalue_visit(ir_texture *ir)
{
handle_rvalue(&ir->coordinate);
handle_rvalue(&ir->projector);
@@ -76,14 +76,14 @@ ir_rvalue_visitor::visit_leave(ir_texture *ir)
}
ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_swizzle *ir)
+ir_rvalue_base_visitor::rvalue_visit(ir_swizzle *ir)
{
handle_rvalue(&ir->val);
return visit_continue;
}
ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_dereference_array *ir)
+ir_rvalue_base_visitor::rvalue_visit(ir_dereference_array *ir)
{
/* The array index is not the target of the assignment, so clear the
* 'in_assignee' flag. Restore it after returning from the array index.
@@ -98,14 +98,14 @@ ir_rvalue_visitor::visit_leave(ir_dereference_array *ir)
}
ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_dereference_record *ir)
+ir_rvalue_base_visitor::rvalue_visit(ir_dereference_record *ir)
{
handle_rvalue(&ir->record);
return visit_continue;
}
ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_assignment *ir)
+ir_rvalue_base_visitor::rvalue_visit(ir_assignment *ir)
{
handle_rvalue(&ir->rhs);
handle_rvalue(&ir->condition);
@@ -114,7 +114,7 @@ ir_rvalue_visitor::visit_leave(ir_assignment *ir)
}
ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_call *ir)
+ir_rvalue_base_visitor::rvalue_visit(ir_call *ir)
{
foreach_iter(exec_list_iterator, iter, *ir) {
ir_rvalue *param = (ir_rvalue *)iter.get();
@@ -129,15 +129,124 @@ ir_rvalue_visitor::visit_leave(ir_call *ir)
}
ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_return *ir)
+ir_rvalue_base_visitor::rvalue_visit(ir_return *ir)
{
handle_rvalue(&ir->value);;
return visit_continue;
}
ir_visitor_status
-ir_rvalue_visitor::visit_leave(ir_if *ir)
+ir_rvalue_base_visitor::rvalue_visit(ir_if *ir)
{
handle_rvalue(&ir->condition);
return visit_continue;
}
+
+
+ir_visitor_status
+ir_rvalue_visitor::visit_leave(ir_expression *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_visitor::visit_leave(ir_texture *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_visitor::visit_leave(ir_swizzle *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_visitor::visit_leave(ir_dereference_array *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_visitor::visit_leave(ir_dereference_record *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_visitor::visit_leave(ir_assignment *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_visitor::visit_leave(ir_call *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_visitor::visit_leave(ir_return *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_visitor::visit_leave(ir_if *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_enter_visitor::visit_enter(ir_expression *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_enter_visitor::visit_enter(ir_texture *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_enter_visitor::visit_enter(ir_swizzle *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_enter_visitor::visit_enter(ir_dereference_array *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_enter_visitor::visit_enter(ir_dereference_record *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_enter_visitor::visit_enter(ir_assignment *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_enter_visitor::visit_enter(ir_call *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_enter_visitor::visit_enter(ir_return *ir)
+{
+ return rvalue_visit(ir);
+}
+
+ir_visitor_status
+ir_rvalue_enter_visitor::visit_enter(ir_if *ir)
+{
+ return rvalue_visit(ir);
+}