glsl2: Early return with visit_continue in loop_analysis::visit(ir_dereference_variab...
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 7 Sep 2010 20:33:48 +0000 (13:33 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 7 Sep 2010 20:36:32 +0000 (13:36 -0700)
Returning early with visit_continue_with_parent prevented the
then-statements and else-statements of if-statements such as the
following from being processed:

  if (some_var) { ... } else { ... }

Fixes piglit test case glsl-fs-loop-nested-if and bugzilla #30030.

src/glsl/loop_analysis.cpp

index 32e8b8c85b3ba333256ef9950b35b2efcb192cf9..91e34da0ee49247ab62ddca076ab45cd5b12eab5 100644 (file)
@@ -154,7 +154,7 @@ loop_analysis::visit(ir_dereference_variable *ir)
    /* If we're not somewhere inside a loop, there's nothing to do.
     */
    if (this->state.is_empty())
-      return visit_continue_with_parent;
+      return visit_continue;
 
    loop_variable_state *const ls =
       (loop_variable_state *) this->state.get_head();