static void llvmpipe_destroy( struct pipe_context *pipe ) { struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe ); uint i; lp_print_counters(); /* This will also destroy llvmpipe->setup: */ if (llvmpipe->draw) draw_destroy( llvmpipe->draw ); for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { pipe_surface_reference(&llvmpipe->framebuffer.cbufs[i], NULL); } pipe_surface_reference(&llvmpipe->framebuffer.zsbuf, NULL); for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { pipe_texture_reference(&llvmpipe->texture[i], NULL); } for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) { pipe_texture_reference(&llvmpipe->vertex_textures[i], NULL); } for (i = 0; i < Elements(llvmpipe->constants); i++) { if (llvmpipe->constants[i]) { pipe_buffer_reference(&llvmpipe->constants[i], NULL); } } align_free( llvmpipe ); }
static void llvmpipe_destroy( struct pipe_context *pipe ) { struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe ); uint i, j; lp_print_counters(); /* This will also destroy llvmpipe->setup: */ if (llvmpipe->draw) draw_destroy( llvmpipe->draw ); for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { pipe_surface_reference(&llvmpipe->framebuffer.cbufs[i], NULL); } pipe_surface_reference(&llvmpipe->framebuffer.zsbuf, NULL); for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { pipe_sampler_view_reference(&llvmpipe->fragment_sampler_views[i], NULL); } for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) { pipe_sampler_view_reference(&llvmpipe->vertex_sampler_views[i], NULL); } for (i = 0; i < Elements(llvmpipe->constants); i++) { for (j = 0; j < Elements(llvmpipe->constants[i]); j++) { pipe_resource_reference(&llvmpipe->constants[i][j], NULL); } } for (i = 0; i < llvmpipe->num_vertex_buffers; i++) { pipe_resource_reference(&llvmpipe->vertex_buffer[i].buffer, NULL); } lp_delete_setup_variants(llvmpipe); align_free( llvmpipe ); }