projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3463b14
)
mesa: fix REMAINDER() macro
author
Brian Paul
<brianp@vmware.com>
Tue, 16 Jun 2009 14:45:06 +0000
(08:45 -0600)
committer
Brian Paul
<brianp@vmware.com>
Tue, 16 Jun 2009 14:45:56 +0000
(08:45 -0600)
The results were incorrect for some negative values of A.
See bug 21872.
src/mesa/swrast/s_texfilter.c
patch
|
blob
|
history
diff --git
a/src/mesa/swrast/s_texfilter.c
b/src/mesa/swrast/s_texfilter.c
index 31bfb5c95204b6411c94fb481ed971b4d98118a7..dd59314cd9671a5d90ea5a5ac251b1b386135bcb 100644
(file)
--- a/
src/mesa/swrast/s_texfilter.c
+++ b/
src/mesa/swrast/s_texfilter.c
@@
-138,7
+138,7
@@
lerp_rgba_3d(GLfloat result[4], GLfloat a, GLfloat b, GLfloat c,
* If A is a signed integer, A % B doesn't give the right value for A < 0
* (in terms of texture repeat). Just casting to unsigned fixes that.
*/
-#define REMAINDER(A, B) ((
unsigned) (A) % (unsigned)
(B))
+#define REMAINDER(A, B) ((
(A) + (B) * 1024) %
(B))
/**