static void brw_texture_destroy(struct pipe_screen *screen, struct pipe_resource *pt) { struct brw_texture *tex = brw_texture(pt); bo_reference(&tex->bo, NULL); FREE(pt); }
static void brw_delete_fs_state( struct pipe_context *pipe, void *prog ) { struct brw_fragment_shader *fs = (struct brw_fragment_shader *)prog; bo_reference(&fs->const_buffer, NULL); FREE( (void *)fs->tokens ); FREE( fs ); }
static void brw_clear_validated_bos(struct brw_context *brw) { int i; /* Clear the last round of validated bos */ for (i = 0; i < brw->state.validated_bo_count; i++) { bo_reference(&brw->state.validated_bos[i], NULL); } brw->state.validated_bo_count = 0; }
void brw_batchbuffer_free(struct brw_batchbuffer *batch) { if (batch->map) { batch->sws->bo_unmap(batch->buf); batch->map = NULL; } bo_reference(&batch->buf, NULL); FREE(batch); }
void brw_pipe_vertex_cleanup( struct brw_context *brw ) { /* Release bound pipe vertex_buffers */ /* Release some other stuff */ #if 0 for (i = 0; i < PIPE_MAX_ATTRIBS; i++) { bo_reference(&brw->vb.inputs[i].bo, NULL); brw->vb.inputs[i].bo = NULL; } #endif }
static void brw_destroy_context( struct pipe_context *pipe ) { struct brw_context *brw = brw_context(pipe); int i; brw_context_flush( brw ); brw_batchbuffer_free( brw->batch ); brw_destroy_state(brw); brw_draw_cleanup( brw ); brw_pipe_blend_cleanup( brw ); brw_pipe_depth_stencil_cleanup( brw ); brw_pipe_framebuffer_cleanup( brw ); brw_pipe_flush_cleanup( brw ); brw_pipe_misc_cleanup( brw ); brw_pipe_query_cleanup( brw ); brw_pipe_rast_cleanup( brw ); brw_pipe_sampler_cleanup( brw ); brw_pipe_shader_cleanup( brw ); brw_pipe_vertex_cleanup( brw ); brw_pipe_clear_cleanup( brw ); brw_hw_cc_cleanup( brw ); FREE(brw->wm.compile_data); for (i = 0; i < brw->curr.fb.nr_cbufs; i++) pipe_surface_reference(&brw->curr.fb.cbufs[i], NULL); brw->curr.fb.nr_cbufs = 0; pipe_surface_reference(&brw->curr.fb.zsbuf, NULL); bo_reference(&brw->curbe.curbe_bo, NULL); bo_reference(&brw->vs.prog_bo, NULL); bo_reference(&brw->vs.state_bo, NULL); bo_reference(&brw->vs.bind_bo, NULL); bo_reference(&brw->gs.prog_bo, NULL); bo_reference(&brw->gs.state_bo, NULL); bo_reference(&brw->clip.prog_bo, NULL); bo_reference(&brw->clip.state_bo, NULL); bo_reference(&brw->clip.vp_bo, NULL); bo_reference(&brw->sf.prog_bo, NULL); bo_reference(&brw->sf.state_bo, NULL); bo_reference(&brw->sf.vp_bo, NULL); for (i = 0; i < Elements(brw->wm.sdc_bo); i++) bo_reference(&brw->wm.sdc_bo[i], NULL); bo_reference(&brw->wm.bind_bo, NULL); for (i = 0; i < Elements(brw->wm.surf_bo); i++) bo_reference(&brw->wm.surf_bo[i], NULL); bo_reference(&brw->wm.sampler_bo, NULL); bo_reference(&brw->wm.prog_bo, NULL); bo_reference(&brw->wm.state_bo, NULL); }