http://bugs.freedesktop.org/show_bug.cgi?id=21872


Brad King <brad.k...@kitware.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brad.k...@kitware.com




--- Comment #2 from Brad King <brad.k...@kitware.com>  2009-06-15 13:01:01 PST 
---
"git bisect" led me to this commit:
------------------------------------------------------------------------------
commit ad053d90f01852ee27e36a21402543562bf46ad6
Author: Brian <brian.p...@tungstengraphics.com>
Date:   Wed Oct 17 14:30:18 2007 -0600

    Replace repeat_remainder() with a simpler macro that just casts args to
unsigned.
------------------------------------------------------------------------------

In master I re-implemented the macro by restoring repeat_remainder() and
forwarding the macro to it.  That fixes the problem.

I've put the patch in-line below, but it removes the optimization attempted by
the original commit.  The patch cannot be used as-is because it does not update
the comment.

diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index 0067d3e..546b421 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -138,8 +138,15 @@ 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))
-
+static INLINE GLint
+repeat_remainder(GLint a, GLint b)
+{
+   if (a >= 0)
+      return a % b;
+   else
+      return (a + 1) % b + b - 1;
+}
+#define REMAINDER(A, B) repeat_remainder(A, B)

 /**
  * Used to compute texel locations for linear sampling.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to