Mesa (master): mesa: fix DIFFERENT_SIGNS() function

Brian Paul brianp at kemper.freedesktop.org
Tue Sep 4 17:38:47 UTC 2012


Module: Mesa
Branch: master
Commit: f73ffacbf0c65ad843406af37aa35e9112bc8038
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f73ffacbf0c65ad843406af37aa35e9112bc8038

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Sep  4 10:02:20 2012 -0600

mesa: fix DIFFERENT_SIGNS() function

Looks like converting this to a macro, returning bool, caused us to
lose the high (31st) bit result.  Fixes piglit fbo-1d test.  Strange
that none of the other tests I ran caught this.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54365

Tested-by: Vinson Lee <vlee at freedesktop.org>

---

 src/mesa/main/macros.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index fc6f2a2..04d59d7 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -711,7 +711,7 @@ DIFFERENT_SIGNS(GLfloat x, GLfloat y)
    fi_type xfi, yfi;
    xfi.f = x;
    yfi.f = y;
-   return (xfi.i ^ yfi.i) & (1u << 31);
+   return !!((xfi.i ^ yfi.i) & (1u << 31));
 #else
    /* Could just use (x*y<0) except for the flatshading requirements.
     * Maybe there's a better way?




More information about the mesa-commit mailing list