static void softpipe_destroy( struct pipe_context *pipe ) { struct softpipe_context *softpipe = softpipe_context( pipe ); uint i, sh; #if DO_PSTIPPLE_IN_HELPER_MODULE if (softpipe->pstipple.sampler) pipe->delete_sampler_state(pipe, softpipe->pstipple.sampler); pipe_resource_reference(&softpipe->pstipple.texture, NULL); pipe_sampler_view_reference(&softpipe->pstipple.sampler_view, NULL); #endif if (softpipe->draw) draw_destroy( softpipe->draw ); if (softpipe->quad.shade) softpipe->quad.shade->destroy( softpipe->quad.shade ); if (softpipe->quad.depth_test) softpipe->quad.depth_test->destroy( softpipe->quad.depth_test ); if (softpipe->quad.blend) softpipe->quad.blend->destroy( softpipe->quad.blend ); if (softpipe->quad.pstipple) softpipe->quad.pstipple->destroy( softpipe->quad.pstipple ); for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { sp_destroy_tile_cache(softpipe->cbuf_cache[i]); pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL); } sp_destroy_tile_cache(softpipe->zsbuf_cache); pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL); for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) { for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) { sp_destroy_tex_tile_cache(softpipe->tex_cache[sh][i]); pipe_sampler_view_reference(&softpipe->sampler_views[sh][i], NULL); } } for (sh = 0; sh < Elements(softpipe->constants); sh++) { for (i = 0; i < Elements(softpipe->constants[0]); i++) { if (softpipe->constants[sh][i]) { pipe_resource_reference(&softpipe->constants[sh][i], NULL); } } } for (i = 0; i < softpipe->num_vertex_buffers; i++) { pipe_resource_reference(&softpipe->vertex_buffer[i].buffer, NULL); } tgsi_exec_machine_destroy(softpipe->fs_machine); FREE( softpipe ); }
static void softpipe_destroy( struct pipe_context *pipe ) { struct softpipe_context *softpipe = softpipe_context( pipe ); uint i; if (softpipe->draw) draw_destroy( softpipe->draw ); softpipe->quad.shade->destroy( softpipe->quad.shade ); softpipe->quad.depth_test->destroy( softpipe->quad.depth_test ); softpipe->quad.blend->destroy( softpipe->quad.blend ); for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { sp_destroy_tile_cache(softpipe->cbuf_cache[i]); pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL); } sp_destroy_tile_cache(softpipe->zsbuf_cache); pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL); for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { sp_destroy_tex_tile_cache(softpipe->tex_cache[i]); pipe_texture_reference(&softpipe->texture[i], NULL); } for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) { sp_destroy_tex_tile_cache(softpipe->vertex_tex_cache[i]); pipe_texture_reference(&softpipe->vertex_textures[i], NULL); } for (i = 0; i < PIPE_SHADER_TYPES; i++) { uint j; for (j = 0; j < PIPE_MAX_CONSTANT_BUFFERS; j++) { if (softpipe->constants[i][j]) { pipe_buffer_reference(&softpipe->constants[i][j], NULL); } } } FREE( softpipe ); }
static void softpipe_destroy( struct pipe_context *pipe ) { struct softpipe_context *softpipe = softpipe_context( pipe ); uint i; #if DO_PSTIPPLE_IN_HELPER_MODULE if (softpipe->pstipple.sampler) pipe->delete_sampler_state(pipe, softpipe->pstipple.sampler); pipe_resource_reference(&softpipe->pstipple.texture, NULL); pipe_sampler_view_reference(&softpipe->pstipple.sampler_view, NULL); #endif if (softpipe->draw) draw_destroy( softpipe->draw ); if (softpipe->quad.shade) softpipe->quad.shade->destroy( softpipe->quad.shade ); if (softpipe->quad.depth_test) softpipe->quad.depth_test->destroy( softpipe->quad.depth_test ); if (softpipe->quad.blend) softpipe->quad.blend->destroy( softpipe->quad.blend ); if (softpipe->quad.pstipple) softpipe->quad.pstipple->destroy( softpipe->quad.pstipple ); for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { sp_destroy_tile_cache(softpipe->cbuf_cache[i]); pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL); } sp_destroy_tile_cache(softpipe->zsbuf_cache); pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL); for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { sp_destroy_tex_tile_cache(softpipe->fragment_tex_cache[i]); pipe_sampler_view_reference(&softpipe->fragment_sampler_views[i], NULL); } for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) { sp_destroy_tex_tile_cache(softpipe->vertex_tex_cache[i]); pipe_sampler_view_reference(&softpipe->vertex_sampler_views[i], NULL); } for (i = 0; i < PIPE_MAX_GEOMETRY_SAMPLERS; i++) { sp_destroy_tex_tile_cache(softpipe->geometry_tex_cache[i]); pipe_sampler_view_reference(&softpipe->geometry_sampler_views[i], NULL); } for (i = 0; i < PIPE_SHADER_TYPES; i++) { uint j; for (j = 0; j < PIPE_MAX_CONSTANT_BUFFERS; j++) { if (softpipe->constants[i][j]) { pipe_resource_reference(&softpipe->constants[i][j], NULL); } } } for (i = 0; i < softpipe->num_vertex_buffers; i++) { pipe_resource_reference(&softpipe->vertex_buffer[i].buffer, NULL); } tgsi_exec_machine_destroy(softpipe->fs_machine); FREE( softpipe ); }