Browse Source

mesa: fix REMAINDER() macro

The results were incorrect for some negative values of A.
See bug 21872.
tags/mesa_7_5_rc4
Brian Paul 16 years ago
parent
commit
ed7f4b4230
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/mesa/swrast/s_texfilter.c

+ 1
- 1
src/mesa/swrast/s_texfilter.c View File

@@ -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))


/**

Loading…
Cancel
Save