summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-03-11 13:08:26 -0800
committerEric Anholt <[email protected]>2011-03-15 09:49:00 -0700
commit991fa4d3d07a3ebda2a1398d346b18b3afbaa736 (patch)
tree33884cb3128d7abb225d25a60251f782201906fa /src
parentd3a444af2d4c42a23e9ec78dbef4c3ee45e1e50c (diff)
glsl: Skip processing expression trees in do_if_simplification().
Reduces time spent in this during glean texCombine by about 2/3.
Diffstat (limited to 'src')
-rw-r--r--src/glsl/opt_if_simplification.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/opt_if_simplification.cpp b/src/glsl/opt_if_simplification.cpp
index 618bacfecf1..29b1d18aa59 100644
--- a/src/glsl/opt_if_simplification.cpp
+++ b/src/glsl/opt_if_simplification.cpp
@@ -38,10 +38,20 @@ public:
}
ir_visitor_status visit_leave(ir_if *);
+ ir_visitor_status visit_enter(ir_assignment *);
bool made_progress;
};
+/* We only care about the top level "if" instructions, so don't
+ * descend into expressions.
+ */
+ir_visitor_status
+ir_if_simplification_visitor::visit_enter(ir_assignment *ir)
+{
+ return visit_continue_with_parent;
+}
+
bool
do_if_simplification(exec_list *instructions)
{