From f73ffacbf0c65ad843406af37aa35e9112bc8038 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 4 Sep 2012 10:02:20 -0600 Subject: [PATCH] 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 --- src/mesa/main/macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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? -- 2.30.2