mesa: don't count buffer references for the context that created them
See mtypes.h - it gives you the top level view of how it works, and other code contains a lot of comments. Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8606>
This commit is contained in:
@@ -85,6 +85,8 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
|
||||
shared->ShaderObjects = _mesa_NewHashTable();
|
||||
|
||||
shared->BufferObjects = _mesa_NewHashTable();
|
||||
shared->ZombieBufferObjects = _mesa_set_create(NULL, _mesa_hash_pointer,
|
||||
_mesa_key_pointer_equal);
|
||||
|
||||
/* GL_ARB_sampler_objects */
|
||||
shared->SamplerObjects = _mesa_NewHashTable();
|
||||
@@ -391,6 +393,13 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
|
||||
_mesa_DeleteHashTable(shared->BufferObjects);
|
||||
}
|
||||
|
||||
if (shared->ZombieBufferObjects) {
|
||||
set_foreach(shared->ZombieBufferObjects, entry) {
|
||||
assert(!"ZombieBufferObjects should be empty");
|
||||
}
|
||||
_mesa_set_destroy(shared->ZombieBufferObjects, NULL);
|
||||
}
|
||||
|
||||
if (shared->FrameBuffers) {
|
||||
_mesa_HashDeleteAll(shared->FrameBuffers, delete_framebuffer_cb, ctx);
|
||||
_mesa_DeleteHashTable(shared->FrameBuffers);
|
||||
|
Reference in New Issue
Block a user