mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
glsl: Fix loop bounds detection.
When analyzing a loop where the loop condition is expressed in the
non-standard order (e.g. "4 > i" instead of "i < 4"), we were
reversing the condition incorrectly, leading to a loop bound that was
off by 1.
Fixes piglit tests {vs,fs}-loop-bounds-unrolled.shader_test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
844d14ebee
commit
09df6bb96d
1 changed files with 4 additions and 4 deletions
|
|
@ -222,10 +222,10 @@ loop_control_visitor::visit_leave(ir_loop *ir)
|
|||
limit = cond->operands[0]->as_constant();
|
||||
|
||||
switch (cmp) {
|
||||
case ir_binop_less: cmp = ir_binop_gequal; break;
|
||||
case ir_binop_greater: cmp = ir_binop_lequal; break;
|
||||
case ir_binop_lequal: cmp = ir_binop_greater; break;
|
||||
case ir_binop_gequal: cmp = ir_binop_less; break;
|
||||
case ir_binop_less: cmp = ir_binop_greater; break;
|
||||
case ir_binop_greater: cmp = ir_binop_less; break;
|
||||
case ir_binop_lequal: cmp = ir_binop_gequal; break;
|
||||
case ir_binop_gequal: cmp = ir_binop_lequal; break;
|
||||
default: assert(!"Should not get here.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue