projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a71527
)
ir_constant_expression: Fix broken code for floating point modulus.
author
Kenneth Graunke
<kenneth@whitecape.org>
Fri, 23 Jul 2010 00:44:34 +0000
(17:44 -0700)
committer
Kenneth Graunke
<kenneth@whitecape.org>
Fri, 23 Jul 2010 00:45:45 +0000
(17:45 -0700)
It's supposed to be x - y * floor(x/y), not (x - y) * floor(x/y).
src/glsl/ir_constant_expression.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/ir_constant_expression.cpp
b/src/glsl/ir_constant_expression.cpp
index 5bef17c7554eedfec5dd8b1ba45a4f7295bc139b..f15530ae89e40e6cd8744d4d38363e45aa795013 100644
(file)
--- 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: