diff options
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_scene.h')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_scene.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h index 3e2bd0e7b38..9467cd6f16d 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.h +++ b/src/gallium/drivers/llvmpipe/lp_scene.h @@ -119,7 +119,11 @@ struct lp_scene { /** list of resources referenced by the scene commands */ struct resource_ref resources; - boolean write_depth; + /** Approx memory used by the scene (in bytes). This includes the + * shared and per-tile bins plus any referenced resources/textures. + */ + unsigned scene_size; + boolean has_color_clear; boolean has_depth_clear; @@ -182,6 +186,8 @@ lp_scene_alloc( struct lp_scene *scene, unsigned size) lp_bin_new_data_block( list ); } + scene->scene_size += size; + { struct data_block *tail = list->tail; ubyte *data = tail->data + tail->used; @@ -204,6 +210,8 @@ lp_scene_alloc_aligned( struct lp_scene *scene, unsigned size, lp_bin_new_data_block( list ); } + scene->scene_size += size; + { struct data_block *tail = list->tail; ubyte *data = tail->data + tail->used; @@ -220,6 +228,7 @@ static INLINE void lp_scene_putback_data( struct lp_scene *scene, unsigned size) { struct data_block_list *list = &scene->data; + scene->scene_size -= size; assert(list->tail->used >= size); list->tail->used -= size; } @@ -302,11 +311,18 @@ lp_scene_bin_iter_next( struct lp_scene *scene, int *bin_x, int *bin_y ); void lp_scene_rasterize( struct lp_scene *scene, - struct lp_rasterizer *rast, - boolean write_depth ); + struct lp_rasterizer *rast ); void lp_scene_begin_binning( struct lp_scene *scene, struct pipe_framebuffer_state *fb ); + +static INLINE unsigned +lp_scene_get_size(const struct lp_scene *scene) +{ + return scene->scene_size; +} + + #endif /* LP_BIN_H */ |