summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2010-01-13 14:41:02 +0000
committerKeith Whitwell <[email protected]>2010-01-13 15:18:32 +0000
commitda45f49cc63fff06513dc28d9616084fc81798d4 (patch)
treed78e13f3fa26bbfdbdf0bd2d2d4d80a31545dbff
parent7e4c75c040bfd93fafb3a3ebbda25db8bd948e18 (diff)
llvmpipe: quick hack to short-circuit empty bins
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast.c23
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c4
2 files changed, 25 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 38c27b90e35..4c13d4d80b5 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -576,6 +576,26 @@ rasterize_bin( struct lp_rasterizer *rast,
lp_rast_end_tile( rast, thread_index );
}
+static boolean
+is_empty_bin( struct lp_rasterizer *rast,
+ const struct cmd_bin *bin )
+{
+ const struct cmd_block *head = bin->commands.head;
+ int i;
+
+ if (head->next != NULL ||
+ head->count > PIPE_MAX_COLOR_BUFS + 1)
+ return FALSE;
+
+ for (i = 0; i < head->count; i++)
+ if (head->cmd[i] != lp_rast_load_color &&
+ head->cmd[i] != lp_rast_load_zstencil)
+ return FALSE;
+
+ return TRUE;
+}
+
+
/**
* Rasterize/execute all bins within a scene.
@@ -606,7 +626,8 @@ rasterize_scene( struct lp_rasterizer *rast,
assert(scene);
while ((bin = lp_scene_bin_iter_next(scene, &x, &y))) {
- rasterize_bin( rast, thread_index, bin, x * TILE_SIZE, y * TILE_SIZE);
+ if (!is_empty_bin( rast, bin ))
+ rasterize_bin( rast, thread_index, bin, x * TILE_SIZE, y * TILE_SIZE);
}
}
#endif
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index 74f3054864c..38ea0c663f1 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -153,7 +153,9 @@ begin_binning( struct setup_context *setup )
{
struct lp_scene *scene = lp_setup_get_current_scene(setup);
- LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
+ LP_DBG(DEBUG_SETUP, "%s color: %s depth: %s\n", __FUNCTION__,
+ (setup->clear.flags & PIPE_CLEAR_COLOR) ? "clear": "load",
+ (setup->clear.flags & PIPE_CLEAR_DEPTHSTENCIL) ? "clear": "load");
if (setup->fb.nr_cbufs) {
if (setup->clear.flags & PIPE_CLEAR_COLOR)