Revert "llvmpipe: try to keep plane c values small"
authorKeith Whitwell <keithw@vmware.com>
Tue, 12 Oct 2010 12:20:39 +0000 (13:20 +0100)
committerKeith Whitwell <keithw@vmware.com>
Tue, 12 Oct 2010 12:20:39 +0000 (13:20 +0100)
This reverts commit 9773722c2b09d5f0615a47cecf4347859474dc56.

Looks like there are some floor/rounding issues here that need
to be better understood.

src/gallium/drivers/llvmpipe/lp_setup_line.c
src/gallium/drivers/llvmpipe/lp_setup_tri.c

index c940860850e8bfe1ad9b7012bdb43e5b91d17009..693ac2817523ed8e49b8f3698ed86f8edf39a107 100644 (file)
@@ -640,7 +640,8 @@ try_setup_line( struct lp_setup_context *setup,
          }
       }
 
-      plane->c = (plane->c + (FIXED_ONE-1)) / FIXED_ONE;
+      plane->dcdx *= FIXED_ONE;
+      plane->dcdy *= FIXED_ONE;
 
       /* find trivial reject offsets for each edge for a single-pixel
        * sized block.  These will be scaled up at each recursive level to
index dfe1bd11ea0c2e06a5542da6a138b5e9272a0348..8fd034666c32e8b272bd521bfe0805d97cd52312 100644 (file)
@@ -343,34 +343,26 @@ do_triangle_ccw(struct lp_setup_context *setup,
        * Also, sometimes (in FBO cases) GL will render upside down
        * to its usual method, in which case it will probably want
        * to use the opposite, top-left convention.
-       *
-       * XXX: Chances are this will get stripped away.  In fact this
-       * is only meaningful if:
-       *
-       *          (plane->c & (FIXED_ONE-1)) == 0
-       *
        */         
-      if ((plane->c & (FIXED_ONE-1)) == 0) {
-         if (plane->dcdx < 0) {
-            /* both fill conventions want this - adjust for left edges */
-            plane->c++;            
+      if (plane->dcdx < 0) {
+         /* both fill conventions want this - adjust for left edges */
+         plane->c++;            
+      }
+      else if (plane->dcdx == 0) {
+         if (setup->pixel_offset == 0) {
+            /* correct for top-left fill convention:
+             */
+            if (plane->dcdy > 0) plane->c++;
          }
-         else if (plane->dcdx == 0) {
-            if (setup->pixel_offset == 0) {
-               /* correct for top-left fill convention:
-                */
-               if (plane->dcdy > 0) plane->c++;
-            }
-            else {
-               /* correct for bottom-left fill convention:
-                */
-               if (plane->dcdy < 0) plane->c++;
-            }
+         else {
+            /* correct for bottom-left fill convention:
+             */
+            if (plane->dcdy < 0) plane->c++;
          }
       }
 
-      plane->c = (plane->c + (FIXED_ONE-1)) / FIXED_ONE;
-
+      plane->dcdx *= FIXED_ONE;
+      plane->dcdy *= FIXED_ONE;
 
       /* find trivial reject offsets for each edge for a single-pixel
        * sized block.  These will be scaled up at each recursive level to