mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 09:00:10 +01:00
nir: fix loop iteration count calculation for floats
Fixes performance regression in SynMark PSPom caused by loops with float
counters not always unrolling.
For example:
for (float i = 0.02; i < 0.9; i += 0.11)
...
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
abcaba497d
commit
4b7dfd8812
1 changed files with 2 additions and 2 deletions
|
|
@ -384,8 +384,8 @@ get_iteration(nir_op cond_op, nir_const_value *initial, nir_const_value *step,
|
|||
case nir_op_flt:
|
||||
case nir_op_feq:
|
||||
case nir_op_fne: {
|
||||
int32_t initial_val = initial->f32[0];
|
||||
int32_t span = limit->f32[0] - initial_val;
|
||||
float initial_val = initial->f32[0];
|
||||
float span = limit->f32[0] - initial_val;
|
||||
iter = span / step->f32[0];
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue