llvmpipe: tweak subpixel_snap() arithmetic
authorBrian Paul <brianp@vmware.com>
Wed, 13 Jan 2010 16:29:43 +0000 (09:29 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 13 Jan 2010 16:32:21 +0000 (09:32 -0700)
This adjustment fixes some rasterization differences between llvmpipe
and softpipe (and other renderers).

src/gallium/drivers/llvmpipe/lp_setup_tri.c

index 9248125de8b0473017b9e842a6061e9b95bd5af1..575265b0f5037820682097653ab1cdf174748c4a 100644 (file)
@@ -237,7 +237,7 @@ static void setup_tri_coefficients( struct setup_context *setup,
 
 static inline int subpixel_snap( float a )
 {
-   return util_iround(FIXED_ONE * a);
+   return util_iround(FIXED_ONE * a - (FIXED_ONE / 2));
 }