diff options
author | Brian Paul <[email protected]> | 2009-06-16 08:45:06 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-06-16 08:45:56 -0600 |
commit | ed7f4b42307bff4633689d6781cd3643f10041e5 (patch) | |
tree | 4cfe1ce7364596dda630099e6f1b13a27047456b /src/mesa | |
parent | 3463b1479d1c70e3b23189c72132e9ad5f710ff9 (diff) |
mesa: fix REMAINDER() macro
The results were incorrect for some negative values of A.
See bug 21872.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/swrast/s_texfilter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 31bfb5c9520..dd59314cd96 100644 --- 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)) /** |