XA_EXPORT void xa_context_destroy(struct xa_context *r) { struct pipe_resource **vsbuf = &r->vs_const_buffer; struct pipe_resource **fsbuf = &r->fs_const_buffer; if (*vsbuf) pipe_resource_reference(vsbuf, NULL); if (*fsbuf) pipe_resource_reference(fsbuf, NULL); if (r->shaders) { xa_shaders_destroy(r->shaders); r->shaders = NULL; } xa_ctx_sampler_views_destroy(r); if (r->cso) { cso_release_all(r->cso); cso_destroy_context(r->cso); r->cso = NULL; } r->pipe->destroy(r->pipe); }
void xa_context_destroy(struct xa_context *r) { struct pipe_resource **vsbuf = &r->vs_const_buffer; struct pipe_resource **fsbuf = &r->fs_const_buffer; if (*vsbuf) pipe_resource_reference(vsbuf, NULL); if (*fsbuf) pipe_resource_reference(fsbuf, NULL); if (r->shaders) { xa_shaders_destroy(r->shaders); r->shaders = NULL; } if (r->cso) { cso_release_all(r->cso); cso_destroy_context(r->cso); r->cso = NULL; } }