llvmpipe: don't store plane.ei value in binned data
authorKeith Whitwell <keithw@vmware.com>
Fri, 15 Oct 2010 12:04:19 +0000 (13:04 +0100)
committerKeith Whitwell <keithw@vmware.com>
Fri, 15 Oct 2010 12:27:47 +0000 (13:27 +0100)
Further reduce the size of a binned triangle.

src/gallium/drivers/llvmpipe/lp_rast.h
src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h
src/gallium/drivers/llvmpipe/lp_setup_line.c
src/gallium/drivers/llvmpipe/lp_setup_point.c
src/gallium/drivers/llvmpipe/lp_setup_tri.c

index 8d8b6210ec787fa524d247532116ebbd2d9c39fd..a64c152cf8317164292e7eee36475a8f444bcb6e 100644 (file)
@@ -100,9 +100,6 @@ struct lp_rast_plane {
 
    /* one-pixel sized trivial reject offsets for each plane */
    int eo;
-
-   /* one-pixel sized trivial accept offsets for each plane */
-   int ei;
 };
 
 /**
index 9976996719aebb5cb941411d367e9122fe8d746b..4825d651c04613f5077ff8c4c5119716b5148c8c 100644 (file)
@@ -82,7 +82,8 @@ TAG(do_block_16)(struct lp_rasterizer_task *task,
       const int dcdx = -plane[j].dcdx * 4;
       const int dcdy = plane[j].dcdy * 4;
       const int cox = plane[j].eo * 4;
-      const int cio = plane[j].ei * 4 - 1;
+      const int ei = plane[j].dcdy - plane[j].dcdx - plane[j].eo;
+      const int cio = ei * 4 - 1;
 
       build_masks(c[j] + cox,
                  cio - cox,
@@ -181,7 +182,8 @@ TAG(lp_rast_triangle)(struct lp_rasterizer_task *task,
         const int dcdx = -plane[j].dcdx * 16;
         const int dcdy = plane[j].dcdy * 16;
         const int cox = plane[j].eo * 16;
-        const int cio = plane[j].ei * 16 - 1;
+         const int ei = plane[j].dcdy - plane[j].dcdx - plane[j].eo;
+         const int cio = ei * 16 - 1;
 
         build_masks(c[j] + cox,
                     cio - cox,
index 2fd9f2e2f2a4a2954b5ee87e20ed9d8ff5d226ab..ece8638b5a626f6838970d90677ad505e62f24a2 100644 (file)
@@ -654,10 +654,6 @@ try_setup_line( struct lp_setup_context *setup,
       plane[i].eo = 0;
       if (plane[i].dcdx < 0) plane[i].eo -= plane[i].dcdx;
       if (plane[i].dcdy > 0) plane[i].eo += plane[i].dcdy;
-
-      /* Calculate trivial accept offsets from the above.
-       */
-      plane[i].ei = plane[i].dcdy - plane[i].dcdx - plane[i].eo;
    }
 
 
@@ -683,25 +679,21 @@ try_setup_line( struct lp_setup_context *setup,
       plane[4].dcdx = -1;
       plane[4].dcdy = 0;
       plane[4].c = 1-bbox.x0;
-      plane[4].ei = 0;
       plane[4].eo = 1;
 
       plane[5].dcdx = 1;
       plane[5].dcdy = 0;
       plane[5].c = bbox.x1+1;
-      plane[5].ei = -1;
       plane[5].eo = 0;
 
       plane[6].dcdx = 0;
       plane[6].dcdy = 1;
       plane[6].c = 1-bbox.y0;
-      plane[6].ei = 0;
       plane[6].eo = 1;
 
       plane[7].dcdx = 0;
       plane[7].dcdy = -1;
       plane[7].c = bbox.y1+1;
-      plane[7].ei = -1;
       plane[7].eo = 0;
    }
 
index e30e70e16d2eb1b4c1658a9cc033530295a99c81..16d21df35e2e550e9df8ca0404ba2cbffee2b60f 100644 (file)
@@ -386,25 +386,21 @@ try_setup_point( struct lp_setup_context *setup,
       plane[0].dcdx = -1;
       plane[0].dcdy = 0;
       plane[0].c = 1-bbox.x0;
-      plane[0].ei = 0;
       plane[0].eo = 1;
 
       plane[1].dcdx = 1;
       plane[1].dcdy = 0;
       plane[1].c = bbox.x1+1;
-      plane[1].ei = -1;
       plane[1].eo = 0;
 
       plane[2].dcdx = 0;
       plane[2].dcdy = 1;
       plane[2].c = 1-bbox.y0;
-      plane[2].ei = 0;
       plane[2].eo = 1;
 
       plane[3].dcdx = 0;
       plane[3].dcdy = -1;
       plane[3].c = bbox.y1+1;
-      plane[3].ei = -1;
       plane[3].eo = 0;
    }
 
index 937821b4c3a5ea9ab878784d3e0f6e7879e06974..6ceda80a716b444aadd872c3f02e3860eb97a2c6 100644 (file)
@@ -374,10 +374,6 @@ do_triangle_ccw(struct lp_setup_context *setup,
       plane[i].eo = 0;
       if (plane[i].dcdx < 0) plane[i].eo -= plane[i].dcdx;
       if (plane[i].dcdy > 0) plane[i].eo += plane[i].dcdy;
-
-      /* Calculate trivial accept offsets from the above.
-       */
-      plane[i].ei = plane[i].dcdy - plane[i].dcdx - plane[i].eo;
    }
 
 
@@ -403,25 +399,21 @@ do_triangle_ccw(struct lp_setup_context *setup,
       plane[3].dcdx = -1;
       plane[3].dcdy = 0;
       plane[3].c = 1-bbox.x0;
-      plane[3].ei = 0;
       plane[3].eo = 1;
 
       plane[4].dcdx = 1;
       plane[4].dcdy = 0;
       plane[4].c = bbox.x1+1;
-      plane[4].ei = -1;
       plane[4].eo = 0;
 
       plane[5].dcdx = 0;
       plane[5].dcdy = 1;
       plane[5].c = 1-bbox.y0;
-      plane[5].ei = 0;
       plane[5].eo = 1;
 
       plane[6].dcdx = 0;
       plane[6].dcdy = -1;
       plane[6].c = bbox.y1+1;
-      plane[6].ei = -1;
       plane[6].eo = 0;
    }
 
@@ -544,7 +536,10 @@ lp_setup_bin_triangle( struct lp_setup_context *setup,
                  plane[i].dcdy * iy0 * TILE_SIZE - 
                  plane[i].dcdx * ix0 * TILE_SIZE);
 
-         ei[i] = plane[i].ei << TILE_ORDER;
+         ei[i] = (plane[i].dcdy - 
+                  plane[i].dcdx - 
+                  plane[i].eo) << TILE_ORDER;
+
          eo[i] = plane[i].eo << TILE_ORDER;
          xstep[i] = -(plane[i].dcdx << TILE_ORDER);
          ystep[i] = plane[i].dcdy << TILE_ORDER;