Mesa (lp-binning): llvmpipe: correct binning maths for iterating over whole tiles

Keith Whitwell keithw at kemper.freedesktop.org
Fri Oct 9 15:08:29 UTC 2009


Module: Mesa
Branch: lp-binning
Commit: 82ec7f018d20e46e9c43ea467354dcfe4f03bae3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=82ec7f018d20e46e9c43ea467354dcfe4f03bae3

Author: Keith Whitwell <keithw at vmware.com>
Date:   Fri Oct  9 16:05:26 2009 +0100

llvmpipe: correct binning maths for iterating over whole tiles

---

 src/gallium/drivers/llvmpipe/lp_rast.c      |    5 +++++
 src/gallium/drivers/llvmpipe/lp_setup_tri.c |   12 ++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index cba50c8..d4f369d 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -192,6 +192,7 @@ void lp_rast_load_zstencil( struct lp_rasterizer *rast,
 void lp_rast_shade_tile( struct lp_rasterizer *rast,
                          const union lp_rast_cmd_arg arg )
 {
+#if 0
    const struct lp_rast_shader_inputs *inputs = arg.shade_tile;
    const unsigned masks[4] = {~0, ~0, ~0, ~0};
    unsigned x, y;
@@ -203,6 +204,10 @@ void lp_rast_shade_tile( struct lp_rasterizer *rast,
    for (y = 0; y < TILE_SIZE; y += 2)
       for (x = 0; x < TILE_SIZE; x += 8)
          lp_rast_shade_quads( rast, inputs, x, y, masks);
+#else
+   RAST_DEBUG("%s\n", __FUNCTION__);
+   memset(rast->tile.color, 0x80, TILE_SIZE * TILE_SIZE * 4);
+#endif
 }
 
 
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 78e5329..c437940 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -357,13 +357,13 @@ do_triangle_ccw(struct setup_context *setup,
    c2 = tri->c2 + tri->dx23 * miny - tri->dy23 * minx;
    c3 = tri->c3 + tri->dx31 * miny - tri->dy31 * minx;
 
-   /* Convert to tile coordinates:
-    */
    minx /= TILESIZE;
-   maxx /= TILESIZE;
    miny /= TILESIZE;
+   maxx /= TILESIZE;
    maxy /= TILESIZE;
-   
+
+   /* Convert to tile coordinates:
+    */
    if (miny == maxy && minx == maxx)
    {
       /* Triangle is contained in a single tile:
@@ -399,13 +399,13 @@ do_triangle_ccw(struct setup_context *setup,
        * Trivially accept or reject blocks, else jump to per-pixel
        * examination above.
        */
-      for (y = miny; y < maxy; y++)
+      for (y = miny; y <= maxy; y++)
       {
 	 float cx1 = c1;
 	 float cx2 = c2;
 	 float cx3 = c3;
 
-	 for (x = minx; x < maxx; x++)
+	 for (x = minx; x <= maxx; x++)
 	 {
 	    if (cx1 + eo1 < 0 || 
 		cx2 + eo2 < 0 ||




More information about the mesa-commit mailing list