diff options
author | Kenneth Graunke <[email protected]> | 2010-07-22 17:44:34 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2010-07-22 17:45:45 -0700 |
commit | 3e882ec84a2493da74c55d105010a37de521e593 (patch) | |
tree | 6414b900acfcc620643cfbf65c89d4c7e7d9c2de /src/glsl/ir_constant_expression.cpp | |
parent | 0a71527dabb7086e81d488451cf4a5cd90380938 (diff) |
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).
Diffstat (limited to 'src/glsl/ir_constant_expression.cpp')
-rw-r--r-- | src/glsl/ir_constant_expression.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index 5bef17c7554..f15530ae89e 100644 --- a/src/glsl/ir_constant_expression.cpp +++ b/src/glsl/ir_constant_expression.cpp @@ -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: |