mesa: set up gl_vert_result and gl_frag_attrib values for gl_ClipDistance.
[mesa.git] / src / glsl / opt_structure_splitting.cpp
index 8686da06afa60d0bebcac9698b09c05fd3749318..2c1f6bb227a96f15bb6c9cf83cd238b76ce686bd 100644 (file)
@@ -38,9 +38,6 @@
 #include "ir_rvalue_visitor.h"
 #include "glsl_types.h"
 
-using std::printf;
-using std::strcmp;
-
 static bool debug = false;
 
 // XXX using variable_entry2 here to avoid collision (MSVC multiply-defined
@@ -154,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) {