free surface caches in softpipe_destroy()
authorBrian <brian.paul@tungstengraphics.com>
Tue, 25 Dec 2007 00:40:02 +0000 (17:40 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Tue, 1 Jan 2008 17:21:21 +0000 (10:21 -0700)
src/mesa/pipe/softpipe/sp_context.c

index b6995b8a6cda55929de0c635851ba560d029c1f5..52672a9b2920b09e24a19a94736748ba792f891a 100644 (file)
@@ -127,6 +127,7 @@ softpipe_unmap_surfaces(struct softpipe_context *sp)
 static void softpipe_destroy( struct pipe_context *pipe )
 {
    struct softpipe_context *softpipe = softpipe_context( pipe );
+   uint i;
 
    draw_destroy( softpipe->draw );
 
@@ -143,6 +144,14 @@ static void softpipe_destroy( struct pipe_context *pipe )
    softpipe->quad.colormask->destroy( softpipe->quad.colormask );
    softpipe->quad.output->destroy( softpipe->quad.output );
 
+   for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++)
+      sp_destroy_tile_cache(softpipe->cbuf_cache[i]);
+   sp_destroy_tile_cache(softpipe->zbuf_cache);
+   sp_destroy_tile_cache(softpipe->sbuf_cache_sep);
+
+   for (i = 0; i < PIPE_MAX_SAMPLERS; i++)
+      sp_destroy_tile_cache(softpipe->tex_cache[i]);
+
    FREE( softpipe );
 }