/** * Free pipeline state for given context. */ void _mesa_free_pipeline_data(struct gl_context *ctx) { _mesa_HashDeleteAll(ctx->Pipeline.Objects, delete_pipelineobj_cb, ctx); _mesa_DeleteHashTable(ctx->Pipeline.Objects); _mesa_reference_pipeline_object(ctx, &ctx->_Shader, NULL); _mesa_delete_pipeline_object(ctx, ctx->Pipeline.Default); }
static void intelDestroyScreen(__DRIscreen * sPriv) { struct intel_screen *intelScreen = sPriv->driverPrivate; dri_bufmgr_destroy(intelScreen->bufmgr); driDestroyOptionInfo(&intelScreen->optionCache); /* Some regions may still have references to them at this point, so * flush the hash table to prevent _mesa_DeleteHashTable() from * complaining about the hash not being empty; */ _mesa_HashDeleteAll(intelScreen->named_regions, nop_callback, NULL); _mesa_DeleteHashTable(intelScreen->named_regions); free(intelScreen); sPriv->driverPrivate = NULL; }
/** * Per-context free/clean-up for transform feedback. */ void _mesa_free_transform_feedback(struct gl_context *ctx) { /* core mesa expects this, even a dummy one, to be available */ assert(ctx->Driver.NewTransformFeedback); _mesa_reference_buffer_object(ctx, &ctx->TransformFeedback.CurrentBuffer, NULL); /* Delete all feedback objects */ _mesa_HashDeleteAll(ctx->TransformFeedback.Objects, delete_cb, ctx); _mesa_DeleteHashTable(ctx->TransformFeedback.Objects); /* Delete the default feedback object */ assert(ctx->Driver.DeleteTransformFeedback); ctx->Driver.DeleteTransformFeedback(ctx, ctx->TransformFeedback.DefaultObject); ctx->TransformFeedback.CurrentObject = NULL; }
/** * Free the context state related to query objects. */ void _mesa_free_query_data(GLcontext *ctx) { _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx); _mesa_DeleteHashTable(ctx->Query.QueryObjects); }
/** * Free vertex array state for given context. */ void _mesa_free_varray_data(struct gl_context *ctx) { _mesa_HashDeleteAll(ctx->Array.Objects, delete_arrayobj_cb, ctx); _mesa_DeleteHashTable(ctx->Array.Objects); }
/** * Deallocate a shared state object and all children structures. * * \param ctx GL context. * \param shared shared state pointer. * * Frees the display lists, the texture objects (calling the driver texture * deletion callback to free its private data) and the vertex programs, as well * as their hash tables. * * \sa alloc_shared_state(). */ void _mesa_free_shared_state(GLcontext *ctx, struct gl_shared_state *shared) { GLuint i; /* * Free display lists */ _mesa_HashDeleteAll(shared->DisplayList, delete_displaylist_cb, ctx); _mesa_DeleteHashTable(shared->DisplayList); #if FEATURE_ARB_shader_objects _mesa_HashWalk(shared->ShaderObjects, free_shader_program_data_cb, ctx); _mesa_HashDeleteAll(shared->ShaderObjects, delete_shader_cb, ctx); _mesa_DeleteHashTable(shared->ShaderObjects); #endif _mesa_HashDeleteAll(shared->Programs, delete_program_cb, ctx); _mesa_DeleteHashTable(shared->Programs); _mesa_HashDeleteAll(shared->ArrayObjects, delete_arrayobj_cb, ctx); _mesa_DeleteHashTable(shared->ArrayObjects); #if FEATURE_ARB_vertex_program _mesa_reference_vertprog(ctx, &shared->DefaultVertexProgram, NULL); #endif #if FEATURE_ARB_fragment_program _mesa_reference_fragprog(ctx, &shared->DefaultFragmentProgram, NULL); #endif #if FEATURE_ATI_fragment_shader _mesa_HashDeleteAll(shared->ATIShaders, delete_fragshader_cb, ctx); _mesa_DeleteHashTable(shared->ATIShaders); _mesa_delete_ati_fragment_shader(ctx, shared->DefaultFragmentShader); #endif #if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object _mesa_HashDeleteAll(shared->BufferObjects, delete_bufferobj_cb, ctx); _mesa_DeleteHashTable(shared->BufferObjects); #endif #if FEATURE_EXT_framebuffer_object _mesa_HashDeleteAll(shared->FrameBuffers, delete_framebuffer_cb, ctx); _mesa_DeleteHashTable(shared->FrameBuffers); _mesa_HashDeleteAll(shared->RenderBuffers, delete_renderbuffer_cb, ctx); _mesa_DeleteHashTable(shared->RenderBuffers); #endif /* * Free texture objects (after FBOs since some textures might have * been bound to FBOs). */ ASSERT(ctx->Driver.DeleteTexture); /* the default textures */ for (i = 0; i < NUM_TEXTURE_TARGETS; i++) { ctx->Driver.DeleteTexture(ctx, shared->DefaultTex[i]); } /* all other textures */ _mesa_HashDeleteAll(shared->TexObjects, delete_texture_cb, ctx); _mesa_DeleteHashTable(shared->TexObjects); _glthread_DESTROY_MUTEX(shared->Mutex); _glthread_DESTROY_MUTEX(shared->TexMutex); _mesa_free(shared); }
/** * Free pipeline state for given context. */ void _mesa_free_pipeline_data(struct gl_context *ctx) { _mesa_HashDeleteAll(ctx->Pipeline.Objects, delete_pipelineobj_cb, ctx); _mesa_DeleteHashTable(ctx->Pipeline.Objects); }