[Mesa-dev] [PATCH 2/9] glsl: Skip processing of expression trees in discard simplification.
Eric Anholt
eric at anholt.net
Fri Mar 11 16:06:46 PST 2011
It only cares about "if", "loop", and "discard".
---
src/glsl/opt_discard_simplification.cpp | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/glsl/opt_discard_simplification.cpp b/src/glsl/opt_discard_simplification.cpp
index 0e577c4..7c2928d 100644
--- a/src/glsl/opt_discard_simplification.cpp
+++ b/src/glsl/opt_discard_simplification.cpp
@@ -95,6 +95,7 @@ public:
ir_visitor_status visit_enter(ir_if *);
ir_visitor_status visit_enter(ir_loop *);
+ ir_visitor_status visit_enter(ir_assignment *);
bool progress;
};
@@ -117,6 +118,15 @@ is_only_instruction(ir_discard *discard)
discard->next->is_tail_sentinel());
}
+/* We only care about the top level instructions, so don't descend
+ * into expressions.
+ */
+ir_visitor_status
+discard_simplifier::visit_enter(ir_assignment *ir)
+{
+ return visit_continue_with_parent;
+}
+
ir_visitor_status
discard_simplifier::visit_enter(ir_if *ir)
{
--
1.7.4.1
More information about the mesa-dev
mailing list