From: Brian Paul Date: Tue, 4 Sep 2012 16:02:20 +0000 (-0600) Subject: mesa: fix DIFFERENT_SIGNS() function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f73ffacbf0c65ad843406af37aa35e9112bc8038;p=mesa.git 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 --- diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index fc6f2a28f20..04d59d79c07 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?