summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_rast.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-12-04 14:47:40 -0700
committerBrian Paul <[email protected]>2009-12-04 14:47:46 -0700
commitb533b56750aca8c7e8cb22af93a0fc2a0cfc0d97 (patch)
treec3eaa181d4a2374d4354ab5c4b40739dffb2e96c /src/gallium/drivers/llvmpipe/lp_rast.c
parent9fca3e065b9ab5ef1389a76934bc24ed2b287a76 (diff)
llvmpipe: move lp_rasterize_bin() into lp_rast.c
First step of moving bin rasterization/execution code out of lp_setup.c
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 5891a2a706d..a466aec379e 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -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 )