From de10168a462f57ead41800ea135476bb5ae8c678 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 12 Jan 2010 17:06:19 -0700 Subject: llvmpipe: added lp_scene_is_empty() --- src/gallium/drivers/llvmpipe/lp_scene.c | 22 ++++++++++++++++++++++ src/gallium/drivers/llvmpipe/lp_scene.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c index 774a1fecd71..70d5847d8ec 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.c +++ b/src/gallium/drivers/llvmpipe/lp_scene.c @@ -66,6 +66,28 @@ lp_scene_init(struct lp_scene *scene) } +/** + * Check if the scene's bins are all empty. + * For debugging purposes. + */ +boolean +lp_scene_is_empty(struct lp_scene *scene ) +{ + unsigned x, y; + + for (y = 0; y < TILES_Y; y++) { + for (x = 0; x < TILES_X; x++) { + const struct cmd_bin *bin = lp_scene_get_bin(scene, x, y); + const struct cmd_block_list *list = &bin->commands; + if (list->head != list->tail || list->head->count > 0) { + return FALSE; + } + } + } + return TRUE; +} + + /** * Set scene to empty state. */ diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h index 796fc516ccc..72557277851 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.h +++ b/src/gallium/drivers/llvmpipe/lp_scene.h @@ -133,6 +133,8 @@ void lp_scene_destroy(struct lp_scene *scene); void lp_scene_init(struct lp_scene *scene); +boolean lp_scene_is_empty(struct lp_scene *scene ); + void lp_scene_reset(struct lp_scene *scene ); void lp_scene_free_bin_data(struct lp_scene *scene); -- cgit v1.2.3