diff options
author | Timothy Arceri <[email protected]> | 2017-04-07 11:40:40 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-04-22 10:01:15 +1000 |
commit | 918cec8cbeeac58b8d9092d6fc4aacb8490eb50c (patch) | |
tree | 927c186256d0e754e0f9d714e56160a8a179d613 /src/mesa/main/arrayobj.c | |
parent | ef6af0d5f7b59bd567c65a41165c321e43de6353 (diff) |
mesa: don't lock hashtables that are not shared across contexts
From Chapter 5 'Shared Objects and Multiple Contexts' of
the OpenGL 4.5 spec:
"Objects which contain references to other objects include
framebuffer, program pipeline, query, transform feedback,
and vertex array objects. Such objects are called container
objects and are not shared"
For we leave locking in place for framebuffer objects because
the EXT fbo extension allowed sharing.
We could maybe just replace the hash with an ordinary hash table
but for now this should remove most of the unnecessary locking.
Reviewed-by: Nicolai Hähnle <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/mesa/main/arrayobj.c')
-rw-r--r-- | src/mesa/main/arrayobj.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 24555d9c7a6..b901a891dc2 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -71,7 +71,7 @@ _mesa_lookup_vao(struct gl_context *ctx, GLuint id) return NULL; else return (struct gl_vertex_array_object *) - _mesa_HashLookup(ctx->Array.Objects, id); + _mesa_HashLookupLocked(ctx->Array.Objects, id); } @@ -108,7 +108,7 @@ _mesa_lookup_vao_err(struct gl_context *ctx, GLuint id, const char *caller) vao = ctx->Array.LastLookedUpVAO; } else { vao = (struct gl_vertex_array_object *) - _mesa_HashLookup(ctx->Array.Objects, id); + _mesa_HashLookupLocked(ctx->Array.Objects, id); /* The ARB_direct_state_access specification says: * @@ -306,7 +306,7 @@ save_array_object(struct gl_context *ctx, struct gl_vertex_array_object *vao) { if (vao->Name > 0) { /* insert into hash table */ - _mesa_HashInsert(ctx->Array.Objects, vao->Name, vao); + _mesa_HashInsertLocked(ctx->Array.Objects, vao->Name, vao); } } @@ -320,7 +320,7 @@ remove_array_object(struct gl_context *ctx, struct gl_vertex_array_object *vao) { if (vao->Name > 0) { /* remove from hash table */ - _mesa_HashRemove(ctx->Array.Objects, vao->Name); + _mesa_HashRemoveLocked(ctx->Array.Objects, vao->Name); } } |