glsl: validate IR after linking (debug builds only)
[mesa.git] / src / glsl / lower_if_to_cond_assign.cpp
index e3a1065d9963e5026df7af2745c33450f87f4e71..b637eb4fe1db16a155f2f8be12c963e955c31c91 100644 (file)
@@ -149,11 +149,9 @@ ir_visitor_status
 ir_if_to_cond_assign_visitor::visit_leave(ir_if *ir)
 {
    /* Only flatten when beyond the GPU's maximum supported nesting depth. */
-   if (this->depth <= this->max_depth)
+   if (this->depth-- <= this->max_depth)
       return visit_continue;
 
-   this->depth--;
-
    bool found_control_flow = false;
    ir_variable *cond_var;
    ir_assignment *assign;