/* * pipe_context */ static void si_destroy_context(struct pipe_context *context) { struct si_context *sctx = (struct si_context *)context; int i; si_dec_framebuffer_counters(&sctx->framebuffer.state); si_release_all_descriptors(sctx); if (sctx->ce_suballocator) u_suballocator_destroy(sctx->ce_suballocator); pipe_resource_reference(&sctx->esgs_ring, NULL); pipe_resource_reference(&sctx->gsvs_ring, NULL); pipe_resource_reference(&sctx->tf_ring, NULL); pipe_resource_reference(&sctx->tess_offchip_ring, NULL); pipe_resource_reference(&sctx->null_const_buf.buffer, NULL); r600_resource_reference(&sctx->border_color_buffer, NULL); free(sctx->border_color_table); r600_resource_reference(&sctx->scratch_buffer, NULL); r600_resource_reference(&sctx->compute_scratch_buffer, NULL); sctx->b.ws->fence_reference(&sctx->last_gfx_fence, NULL); si_pm4_free_state(sctx, sctx->init_config, ~0); if (sctx->init_config_gs_rings) si_pm4_free_state(sctx, sctx->init_config_gs_rings, ~0); for (i = 0; i < ARRAY_SIZE(sctx->vgt_shader_config); i++) si_pm4_delete_state(sctx, vgt_shader_config, sctx->vgt_shader_config[i]); if (sctx->fixed_func_tcs_shader.cso) sctx->b.b.delete_tcs_state(&sctx->b.b, sctx->fixed_func_tcs_shader.cso); if (sctx->custom_dsa_flush) sctx->b.b.delete_depth_stencil_alpha_state(&sctx->b.b, sctx->custom_dsa_flush); if (sctx->custom_blend_resolve) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_resolve); if (sctx->custom_blend_decompress) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_decompress); if (sctx->custom_blend_fastclear) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_fastclear); if (sctx->custom_blend_dcc_decompress) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_dcc_decompress); util_unreference_framebuffer_state(&sctx->framebuffer.state); if (sctx->blitter) util_blitter_destroy(sctx->blitter); r600_common_context_cleanup(&sctx->b); LLVMDisposeTargetMachine(sctx->tm); r600_resource_reference(&sctx->trace_buf, NULL); r600_resource_reference(&sctx->last_trace_buf, NULL); free(sctx->last_ib); if (sctx->last_bo_list) { for (i = 0; i < sctx->last_bo_count; i++) pb_reference(&sctx->last_bo_list[i].buf, NULL); free(sctx->last_bo_list); } FREE(sctx); }
/* * pipe_context */ static void si_destroy_context(struct pipe_context *context) { struct si_context *sctx = (struct si_context *)context; si_release_all_descriptors(sctx); pipe_resource_reference(&sctx->null_const_buf.buffer, NULL); r600_resource_reference(&sctx->border_color_table, NULL); si_pm4_delete_state(sctx, gs_rings, sctx->gs_rings); si_pm4_delete_state(sctx, gs_onoff, sctx->gs_on); si_pm4_delete_state(sctx, gs_onoff, sctx->gs_off); if (sctx->dummy_pixel_shader) { sctx->b.b.delete_fs_state(&sctx->b.b, sctx->dummy_pixel_shader); } for (int i = 0; i < 8; i++) { sctx->b.b.delete_depth_stencil_alpha_state(&sctx->b.b, sctx->custom_dsa_flush_depth_stencil[i]); sctx->b.b.delete_depth_stencil_alpha_state(&sctx->b.b, sctx->custom_dsa_flush_depth[i]); sctx->b.b.delete_depth_stencil_alpha_state(&sctx->b.b, sctx->custom_dsa_flush_stencil[i]); } sctx->b.b.delete_depth_stencil_alpha_state(&sctx->b.b, sctx->custom_dsa_flush_inplace); sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_resolve); sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_decompress); sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_fastclear); util_unreference_framebuffer_state(&sctx->framebuffer.state); util_blitter_destroy(sctx->blitter); si_pm4_cleanup(sctx); r600_common_context_cleanup(&sctx->b); FREE(sctx); }
static void r600_destroy_context(struct pipe_context *context) { struct r600_context *rctx = (struct r600_context *)context; si_release_all_descriptors(rctx); pipe_resource_reference(&rctx->null_const_buf.buffer, NULL); r600_resource_reference(&rctx->border_color_table, NULL); if (rctx->dummy_pixel_shader) { rctx->b.b.delete_fs_state(&rctx->b.b, rctx->dummy_pixel_shader); } for (int i = 0; i < 8; i++) { rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush_depth_stencil[i]); rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush_depth[i]); rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush_stencil[i]); } rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush_inplace); rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_resolve); rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_decompress); util_unreference_framebuffer_state(&rctx->framebuffer); util_blitter_destroy(rctx->blitter); if (rctx->uploader) { u_upload_destroy(rctx->uploader); } util_slab_destroy(&rctx->pool_transfers); r600_common_context_cleanup(&rctx->b); FREE(rctx); }
/* * pipe_context */ static void si_destroy_context(struct pipe_context *context) { struct si_context *sctx = (struct si_context *)context; int i; /* Unreference the framebuffer normally to disable related logic * properly. */ struct pipe_framebuffer_state fb = {}; context->set_framebuffer_state(context, &fb); si_release_all_descriptors(sctx); if (sctx->ce_suballocator) u_suballocator_destroy(sctx->ce_suballocator); pipe_resource_reference(&sctx->esgs_ring, NULL); pipe_resource_reference(&sctx->gsvs_ring, NULL); pipe_resource_reference(&sctx->tf_ring, NULL); pipe_resource_reference(&sctx->tess_offchip_ring, NULL); pipe_resource_reference(&sctx->null_const_buf.buffer, NULL); r600_resource_reference(&sctx->border_color_buffer, NULL); free(sctx->border_color_table); r600_resource_reference(&sctx->scratch_buffer, NULL); r600_resource_reference(&sctx->compute_scratch_buffer, NULL); si_pm4_free_state(sctx, sctx->init_config, ~0); if (sctx->init_config_gs_rings) si_pm4_free_state(sctx, sctx->init_config_gs_rings, ~0); for (i = 0; i < ARRAY_SIZE(sctx->vgt_shader_config); i++) si_pm4_delete_state(sctx, vgt_shader_config, sctx->vgt_shader_config[i]); if (sctx->fixed_func_tcs_shader.cso) sctx->b.b.delete_tcs_state(&sctx->b.b, sctx->fixed_func_tcs_shader.cso); if (sctx->custom_dsa_flush) sctx->b.b.delete_depth_stencil_alpha_state(&sctx->b.b, sctx->custom_dsa_flush); if (sctx->custom_blend_resolve) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_resolve); if (sctx->custom_blend_decompress) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_decompress); if (sctx->custom_blend_fastclear) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_fastclear); if (sctx->custom_blend_dcc_decompress) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_dcc_decompress); if (sctx->blitter) util_blitter_destroy(sctx->blitter); r600_common_context_cleanup(&sctx->b); LLVMDisposeTargetMachine(sctx->tm); r600_resource_reference(&sctx->trace_buf, NULL); r600_resource_reference(&sctx->last_trace_buf, NULL); radeon_clear_saved_cs(&sctx->last_gfx); FREE(sctx); }
static void r600_destroy_context(struct pipe_context *context) { struct r600_context *rctx = (struct r600_context *)context; unsigned sh; r600_isa_destroy(rctx->isa); r600_sb_context_destroy(rctx->sb_context); r600_resource_reference(&rctx->dummy_cmask, NULL); r600_resource_reference(&rctx->dummy_fmask, NULL); for (sh = 0; sh < PIPE_SHADER_TYPES; sh++) { rctx->b.b.set_constant_buffer(&rctx->b.b, sh, R600_BUFFER_INFO_CONST_BUFFER, NULL); free(rctx->driver_consts[sh].constants); } if (rctx->fixed_func_tcs_shader) rctx->b.b.delete_tcs_state(&rctx->b.b, rctx->fixed_func_tcs_shader); if (rctx->dummy_pixel_shader) { rctx->b.b.delete_fs_state(&rctx->b.b, rctx->dummy_pixel_shader); } if (rctx->custom_dsa_flush) { rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush); } if (rctx->custom_blend_resolve) { rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_resolve); } if (rctx->custom_blend_decompress) { rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_decompress); } if (rctx->custom_blend_fastclear) { rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_fastclear); } util_unreference_framebuffer_state(&rctx->framebuffer.state); if (rctx->blitter) { util_blitter_destroy(rctx->blitter); } if (rctx->allocator_fetch_shader) { u_suballocator_destroy(rctx->allocator_fetch_shader); } r600_release_command_buffer(&rctx->start_cs_cmd); FREE(rctx->start_compute_cs_cmd.buf); r600_common_context_cleanup(&rctx->b); r600_resource_reference(&rctx->trace_buf, NULL); r600_resource_reference(&rctx->last_trace_buf, NULL); radeon_clear_saved_cs(&rctx->last_gfx); FREE(rctx); }
/* * pipe_context */ static void si_destroy_context(struct pipe_context *context) { struct si_context *sctx = (struct si_context *)context; int i; si_release_all_descriptors(sctx); pipe_resource_reference(&sctx->esgs_ring, NULL); pipe_resource_reference(&sctx->gsvs_ring, NULL); pipe_resource_reference(&sctx->tf_ring, NULL); pipe_resource_reference(&sctx->null_const_buf.buffer, NULL); r600_resource_reference(&sctx->border_color_table, NULL); r600_resource_reference(&sctx->scratch_buffer, NULL); sctx->b.ws->fence_reference(&sctx->last_gfx_fence, NULL); si_pm4_free_state(sctx, sctx->init_config, ~0); si_pm4_delete_state(sctx, gs_rings, sctx->gs_rings); si_pm4_delete_state(sctx, tf_ring, sctx->tf_state); for (i = 0; i < Elements(sctx->vgt_shader_config); i++) si_pm4_delete_state(sctx, vgt_shader_config, sctx->vgt_shader_config[i]); if (sctx->pstipple_sampler_state) sctx->b.b.delete_sampler_state(&sctx->b.b, sctx->pstipple_sampler_state); if (sctx->dummy_pixel_shader) sctx->b.b.delete_fs_state(&sctx->b.b, sctx->dummy_pixel_shader); if (sctx->fixed_func_tcs_shader) sctx->b.b.delete_tcs_state(&sctx->b.b, sctx->fixed_func_tcs_shader); if (sctx->custom_dsa_flush) sctx->b.b.delete_depth_stencil_alpha_state(&sctx->b.b, sctx->custom_dsa_flush); if (sctx->custom_blend_resolve) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_resolve); if (sctx->custom_blend_decompress) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_decompress); if (sctx->custom_blend_fastclear) sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_fastclear); util_unreference_framebuffer_state(&sctx->framebuffer.state); if (sctx->blitter) util_blitter_destroy(sctx->blitter); si_pm4_cleanup(sctx); r600_common_context_cleanup(&sctx->b); #if HAVE_LLVM >= 0x0306 LLVMDisposeTargetMachine(sctx->tm); #endif FREE(sctx); }
static void r600_destroy_context(struct pipe_context *context) { struct r600_context *rctx = (struct r600_context *)context; r600_isa_destroy(rctx->isa); r600_sb_context_destroy(rctx->sb_context); pipe_resource_reference((struct pipe_resource**)&rctx->dummy_cmask, NULL); pipe_resource_reference((struct pipe_resource**)&rctx->dummy_fmask, NULL); if (rctx->fixed_func_tcs_shader) rctx->b.b.delete_tcs_state(&rctx->b.b, rctx->fixed_func_tcs_shader); if (rctx->dummy_pixel_shader) { rctx->b.b.delete_fs_state(&rctx->b.b, rctx->dummy_pixel_shader); } if (rctx->custom_dsa_flush) { rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush); } if (rctx->custom_blend_resolve) { rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_resolve); } if (rctx->custom_blend_decompress) { rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_decompress); } if (rctx->custom_blend_fastclear) { rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_fastclear); } util_unreference_framebuffer_state(&rctx->framebuffer.state); if (rctx->blitter) { util_blitter_destroy(rctx->blitter); } if (rctx->allocator_fetch_shader) { u_suballocator_destroy(rctx->allocator_fetch_shader); } r600_release_command_buffer(&rctx->start_cs_cmd); FREE(rctx->start_compute_cs_cmd.buf); r600_common_context_cleanup(&rctx->b); FREE(rctx); }