mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 04:00:10 +01:00
mesa: Fix double-lock of Shared->FrameBuffers and usage of wrong mutex
Fixes:7534c536caFixes:8cfb3e4ee5Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3024 Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5160>
This commit is contained in:
parent
0d2ec80dea
commit
4025583123
1 changed files with 1 additions and 8 deletions
|
|
@ -174,21 +174,16 @@ _mesa_lookup_framebuffer_dsa(struct gl_context *ctx, GLuint id,
|
|||
/* Name exists but buffer is not initialized */
|
||||
if (fb == &DummyFramebuffer) {
|
||||
fb = ctx->Driver.NewFramebuffer(ctx, id);
|
||||
_mesa_HashLockMutex(ctx->Shared->FrameBuffers);
|
||||
_mesa_HashInsert(ctx->Shared->FrameBuffers, id, fb);
|
||||
_mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
|
||||
}
|
||||
/* Name doesn't exist */
|
||||
else if (!fb) {
|
||||
_mesa_HashLockMutex(ctx->Shared->FrameBuffers);
|
||||
fb = ctx->Driver.NewFramebuffer(ctx, id);
|
||||
if (!fb) {
|
||||
_mesa_HashUnlockMutex(ctx->Shared->FrameBuffers);
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
|
||||
return NULL;
|
||||
}
|
||||
_mesa_HashInsertLocked(ctx->Shared->BufferObjects, id, fb);
|
||||
_mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
|
||||
_mesa_HashInsert(ctx->Shared->FrameBuffers, id, fb);
|
||||
}
|
||||
return fb;
|
||||
}
|
||||
|
|
@ -4764,9 +4759,7 @@ lookup_named_framebuffer_ext_dsa(struct gl_context *ctx, GLuint framebuffer, con
|
|||
/* Then, make sure it's initialized */
|
||||
if (fb == &DummyFramebuffer) {
|
||||
fb = ctx->Driver.NewFramebuffer(ctx, framebuffer);
|
||||
_mesa_HashLockMutex(ctx->Shared->FrameBuffers);
|
||||
_mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, fb);
|
||||
_mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue