diff options
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_scene.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_scene.c | 82 |
1 files changed, 17 insertions, 65 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c index 71d9529230b..1482a777ff8 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.c +++ b/src/gallium/drivers/llvmpipe/lp_scene.c @@ -32,7 +32,6 @@ #include "util/u_surface.h" #include "lp_scene.h" #include "lp_scene_queue.h" -#include "lp_debug.h" /** List of texture references */ @@ -43,6 +42,10 @@ struct texture_ref { +/** + * Create a new scene object. + * \param queue the queue to put newly rendered/emptied scenes into + */ struct lp_scene * lp_scene_create( struct pipe_context *pipe, struct lp_scene_queue *queue ) @@ -195,6 +198,8 @@ lp_scene_reset(struct lp_scene *scene ) make_empty_list(ref_list); } + scene->scene_size = 0; + scene->has_color_clear = FALSE; scene->has_depth_clear = FALSE; } @@ -226,7 +231,10 @@ lp_bin_new_data_block( struct data_block_list *list ) } -/** Return number of bytes used for all bin data within a scene */ +/** + * Return number of bytes used for all bin data within a scene. + * This does not include resources (textures) referenced by the scene. + */ unsigned lp_scene_data_size( const struct lp_scene *scene ) { @@ -267,6 +275,8 @@ lp_scene_add_resource_reference(struct lp_scene *scene, pipe_resource_reference(&ref->resource, resource); insert_at_tail(ref_list, ref); } + + scene->scene_size += llvmpipe_resource_size(resource); } @@ -401,61 +411,6 @@ end: } - -/** - * Prepare this scene for the rasterizer. - * Map the framebuffer surfaces. Initialize the 'rast' state. - */ -static boolean -lp_scene_map_buffers( struct lp_scene *scene ) -{ - LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); - - /* XXX framebuffer surfaces are no longer mapped here */ - /* XXX move all map/unmap stuff into rast module... */ - - return TRUE; -} - - - -/** - * Called after rasterizer as finished rasterizing a scene. - * - * We want to call this from the pipe_context's current thread to - * avoid having to have mutexes on the transfer functions. - */ -static void -lp_scene_unmap_buffers( struct lp_scene *scene ) -{ -#if 0 - unsigned i; - - for (i = 0; i < scene->fb.nr_cbufs; i++) { - if (scene->cbuf_map[i]) { - struct pipe_surface *cbuf = scene->fb.cbufs[i]; - llvmpipe_resource_unmap(cbuf->texture, - cbuf->face, - cbuf->level, - cbuf->zslice); - scene->cbuf_map[i] = NULL; - } - } - - if (scene->zsbuf_map) { - struct pipe_surface *zsbuf = scene->fb.zsbuf; - llvmpipe_resource_unmap(zsbuf->texture, - zsbuf->face, - zsbuf->level, - zsbuf->zslice); - scene->zsbuf_map = NULL; - } -#endif - - util_unreference_framebuffer_state( &scene->fb ); -} - - void lp_scene_begin_binning( struct lp_scene *scene, struct pipe_framebuffer_state *fb ) { @@ -472,8 +427,7 @@ void lp_scene_begin_binning( struct lp_scene *scene, void lp_scene_rasterize( struct lp_scene *scene, - struct lp_rasterizer *rast, - boolean write_depth ) + struct lp_rasterizer *rast ) { if (0) { unsigned x, y; @@ -487,11 +441,6 @@ void lp_scene_rasterize( struct lp_scene *scene, } } - scene->write_depth = (scene->fb.zsbuf != NULL && - write_depth); - - lp_scene_map_buffers( scene ); - /* Enqueue the scene for rasterization, then immediately wait for * it to finish. */ @@ -502,6 +451,9 @@ void lp_scene_rasterize( struct lp_scene *scene, * transfers become per-context: */ lp_rast_finish( rast ); - lp_scene_unmap_buffers( scene ); + + util_unreference_framebuffer_state( &scene->fb ); + + /* put scene into the empty list */ lp_scene_enqueue( scene->empty_queue, scene ); } |