r600: fix texcoords from constants
[mesa.git] / src / mesa / swrast / s_texfilter.c
index 0067d3eeb73658d4fd02d7ffac99cbce75ec7404..efe6f234740250a5653254e93606dea3836509cf 100644 (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))
 
 
 /**
@@ -1862,7 +1862,7 @@ choose_cube_face(const struct gl_texture_object *texObj,
    GLuint face;
    GLfloat sc, tc, ma;
 
-   if (arx > ary && arx > arz) {
+   if (arx >= ary && arx >= arz) {
       if (rx >= 0.0F) {
          face = FACE_POS_X;
          sc = -rz;
@@ -1876,7 +1876,7 @@ choose_cube_face(const struct gl_texture_object *texObj,
          ma = arx;
       }
    }
-   else if (ary > arx && ary > arz) {
+   else if (ary >= arx && ary >= arz) {
       if (ry >= 0.0F) {
          face = FACE_POS_Y;
          sc = rx;