summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_structure_splitting.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-03-11 13:17:03 -0800
committerEric Anholt <[email protected]>2011-03-15 09:49:01 -0700
commit05cf1ad82eb903eb07d7b379d0ea610bb43dd84a (patch)
tree73f054b1af44e095a0fac01e0336db8091c72f68 /src/glsl/opt_structure_splitting.cpp
parent991fa4d3d07a3ebda2a1398d346b18b3afbaa736 (diff)
glsl: Reduce processing of expression trees in do_structure_splitting.
Most of the time we don't have a non-uniform struct variable in the shader, so this cuts the time spent in do_structure_splitting during glean texCombine by about 2/3.
Diffstat (limited to 'src/glsl/opt_structure_splitting.cpp')
-rw-r--r--src/glsl/opt_structure_splitting.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/opt_structure_splitting.cpp b/src/glsl/opt_structure_splitting.cpp
index 014407c0be2..2c1f6bb227a 100644
--- a/src/glsl/opt_structure_splitting.cpp
+++ b/src/glsl/opt_structure_splitting.cpp
@@ -151,6 +151,12 @@ ir_structure_reference_visitor::visit_enter(ir_dereference_record *ir)
ir_visitor_status
ir_structure_reference_visitor::visit_enter(ir_assignment *ir)
{
+ /* If there are no structure references yet, no need to bother with
+ * processing the expression tree.
+ */
+ if (this->variable_list.is_empty())
+ return visit_continue_with_parent;
+
if (ir->lhs->as_dereference_variable() &&
ir->rhs->as_dereference_variable() &&
!ir->condition) {