mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 21:30:09 +01:00
ir_constant_expression: Fix broken code for floating point modulus.
It's supposed to be x - y * floor(x/y), not (x - y) * floor(x/y).
This commit is contained in:
parent
0a71527dab
commit
3e882ec84a
1 changed files with 1 additions and 1 deletions
|
|
@ -533,7 +533,7 @@ ir_expression::constant_expression_value()
|
|||
/* We don't use fmod because it rounds toward zero; GLSL specifies
|
||||
* the use of floor.
|
||||
*/
|
||||
data.f[c] = (op[0]->value.f[c0] - op[1]->value.f[c1])
|
||||
data.f[c] = op[0]->value.f[c0] - op[1]->value.f[c1]
|
||||
* floorf(op[0]->value.f[c0] / op[1]->value.f[c1]);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue