llvmpipe: move lp_rasterize_bin() into lp_rast.c
authorBrian Paul <brianp@vmware.com>
Fri, 4 Dec 2009 21:47:40 +0000 (14:47 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 4 Dec 2009 21:47:46 +0000 (14:47 -0700)
First step of moving bin rasterization/execution code out of lp_setup.c

src/gallium/drivers/llvmpipe/lp_rast.c
src/gallium/drivers/llvmpipe/lp_rast.h
src/gallium/drivers/llvmpipe/lp_setup.c

index 5891a2a706d7a94c988f640c7e70b0c9e75f8a64..a466aec379e3fa11e524ae258cbff596892acee5 100644 (file)
@@ -33,6 +33,7 @@
 #include "lp_rast_priv.h"
 #include "lp_tile_soa.h"
 #include "lp_bld_debug.h"
+#include "lp_bin.h"
 
 
 struct lp_rasterizer *lp_rast_create( struct pipe_screen *screen )
@@ -148,9 +149,9 @@ void lp_rast_end( struct lp_rasterizer *rast )
  * \param x  window X position of the tile, in pixels
  * \param y  window Y position of the tile, in pixels
  */
-void lp_rast_start_tile( struct lp_rasterizer *rast,
-                        unsigned x,
-                        unsigned y )
+static void
+lp_rast_start_tile( struct lp_rasterizer *rast,
+                    unsigned x, unsigned y )
 {
    LP_DBG(DEBUG_RAST, "%s %d,%d\n", __FUNCTION__, x, y);
 
@@ -453,7 +454,8 @@ static void lp_rast_store_zstencil( struct lp_rasterizer *rast )
 /**
  * Write the rasterizer's tiles to the framebuffer.
  */
-void lp_rast_end_tile( struct lp_rasterizer *rast )
+static void
+lp_rast_end_tile( struct lp_rasterizer *rast )
 {
    LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__);
 
@@ -465,6 +467,33 @@ void lp_rast_end_tile( struct lp_rasterizer *rast )
 }
 
 
+/**
+ * Rasterize commands for a single bin.
+ * Must be called between lp_rast_begin() and lp_rast_end().
+ */
+void
+lp_rasterize_bin( struct lp_rasterizer *rast,
+                  const struct cmd_bin *bin,
+                  int x, int y)
+{
+   const struct cmd_block_list *commands = &bin->commands;
+   struct cmd_block *block;
+   unsigned k;
+
+   lp_rast_start_tile( rast, x, y );
+
+   /* simply execute each of the commands in the block list */
+   for (block = commands->head; block; block = block->next) {
+      for (k = 0; k < block->count; k++) {
+         block->cmd[k]( rast, block->arg[k] );
+      }
+   }
+
+   lp_rast_end_tile( rast );
+}
+
+
+
 /* Shutdown:
  */
 void lp_rast_destroy( struct lp_rasterizer *rast )
index 21bbf104b15db8977cdbec080038a1c9ffb5db5f..3d2388b8948422ee676daf3ed9e2eb52fe1cd90b 100644 (file)
@@ -47,6 +47,7 @@
  * individual function calls like this.
  */
 struct lp_rasterizer;
+struct cmd_bin;
 struct pipe_screen;
 
 #define FIXED_ORDER 4
@@ -141,14 +142,13 @@ boolean lp_rast_begin( struct lp_rasterizer *rast,
                        unsigned width,
                        unsigned height );
 
-void lp_rast_end( struct lp_rasterizer * );
+void
+lp_rasterize_bin( struct lp_rasterizer *rast,
+                  const struct cmd_bin *bin,
+                  int x, int y);
 
-/* Begining of each tile:
- */
-void lp_rast_start_tile( struct lp_rasterizer *,
-                        unsigned x,
-                        unsigned y );
 
+void lp_rast_end( struct lp_rasterizer * );
 
 
 union lp_rast_cmd_arg {
@@ -224,10 +224,4 @@ void lp_rast_shade_tile( struct lp_rasterizer *,
                          const union lp_rast_cmd_arg );
 
 
-/* End of tile:
- */
-
-void lp_rast_end_tile( struct lp_rasterizer *rast );
-
-
 #endif
index 38609ec88a2a0c2dbb3d389b3da7364f5381a4cc..47d2ac8e118608d9ce46c6a6027ebbbc95aad312 100644 (file)
@@ -207,29 +207,6 @@ bin_state_command( struct setup_context *setup,
 }
 
 
-/** Rasterize commands for a single bin */
-static void
-rasterize_bin( struct lp_rasterizer *rast,
-               const struct cmd_bin *bin,
-               int x, int y)
-{
-   const struct cmd_block_list *commands = &bin->commands;
-   struct cmd_block *block;
-   unsigned k;
-
-   lp_rast_start_tile( rast, x, y );
-
-   /* simply execute each of the commands in the block list */
-   for (block = commands->head; block; block = block->next) {
-      for (k = 0; k < block->count; k++) {
-         block->cmd[k]( rast, block->arg[k] );
-      }
-   }
-
-   lp_rast_end_tile( rast );
-}
-
-
 /** Rasterize all tile's bins */
 static void
 rasterize_bins( struct setup_context *setup,
@@ -251,9 +228,9 @@ rasterize_bins( struct setup_context *setup,
    /* loop over tile bins, rasterize each */
    for (i = 0; i < setup->tiles_x; i++) {
       for (j = 0; j < setup->tiles_y; j++) {
-         rasterize_bin( rast, &setup->tile[i][j], 
-                        i * TILE_SIZE,
-                        j * TILE_SIZE );
+         lp_rasterize_bin( rast, &setup->tile[i][j], 
+                           i * TILE_SIZE,
+                           j * TILE_SIZE );
       }
    }