[Mesa-dev] [PATCH 10/11] glsl: In lower_jumps.cpp, lower both branches of a conditional.
stereotype441 at gmail.com
Tue Jul 5 15:07:31 PDT 2011
Previously, lower_jumps.cpp would break out of its loop after lowering
a jump instruction in just the then- or else-branch of a conditional,
and it would fail to lower a jump instruction occurring in the other
Without this patch, lower_jumps.cpp may require multiple passes in
order lower all jumps, resulting in sub-optimal output.
Fixes unit test test_lower_returns_4.
src/glsl/lower_jumps.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/glsl/lower_jumps.cpp b/src/glsl/lower_jumps.cpp
index 103d64f..2424a54 100644
@@ -640,7 +640,10 @@ lower_continue:
block_records[lower].min_strength = strength_always_clears_execute_flag;
block_records[lower].may_clear_execute_flag = true;
this->progress = true;
+ /* Let the loop run again, in case the other branch of the
+ * if needs to be lowered too.
More information about the mesa-dev