Mesa (lp-binning): llvmpipe: use bin iteration functions when rasterizing bins

Brian Paul brianp at kemper.freedesktop.org
Tue Dec 8 01:16:04 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Dec  7 15:31:50 2009 -0700

llvmpipe: use bin iteration functions when rasterizing bins

---

 src/gallium/drivers/llvmpipe/lp_rast.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 642f1b9..a6192e5 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -505,8 +505,6 @@ lp_rasterize_bins( struct lp_rasterizer *rast,
                    const struct pipe_framebuffer_state *fb,
                    bool write_depth )
 {
-   unsigned i, j;
-
    LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
 
    lp_rast_begin( rast,
@@ -518,12 +516,28 @@ lp_rasterize_bins( struct lp_rasterizer *rast,
                   fb->height );
                        
    /* loop over tile bins, rasterize each */
-   for (i = 0; i < bins->tiles_x; i++) {
-      for (j = 0; j < bins->tiles_y; j++) {
-         struct cmd_bin *bin = lp_get_bin(bins, i, j);
-         rasterize_bin( rast, bin, i * TILE_SIZE, j * TILE_SIZE );
+#if 0
+   {
+      unsigned i, j;
+      for (i = 0; i < bins->tiles_x; i++) {
+         for (j = 0; j < bins->tiles_y; j++) {
+            struct cmd_bin *bin = lp_get_bin(bins, i, j);
+            rasterize_bin( rast, bin, i * TILE_SIZE, j * TILE_SIZE );
+         }
       }
    }
+#else
+   {
+      struct cmd_bin *bin;
+      int x, y;
+
+      lp_bin_iter_begin( bins );
+
+      while ((bin = lp_bin_iter_next(bins, &x, &y))) {
+         rasterize_bin( rast, bin, x * TILE_SIZE, y * TILE_SIZE);
+      }
+   }
+#endif
 
    lp_rast_end( rast );
 




More information about the mesa-commit mailing list