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/transformfeedback.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/transformfeedback.c')
-rw-r--r-- | src/mesa/main/transformfeedback.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 131014ff653..3c72674d6c1 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -965,7 +965,7 @@ _mesa_lookup_transform_feedback_object(struct gl_context *ctx, GLuint name) } else return (struct gl_transform_feedback_object *) - _mesa_HashLookup(ctx->TransformFeedback.Objects, name); + _mesa_HashLookupLocked(ctx->TransformFeedback.Objects, name); } static void @@ -1000,7 +1000,8 @@ create_transform_feedbacks(struct gl_context *ctx, GLsizei n, GLuint *ids, return; } ids[i] = first + i; - _mesa_HashInsert(ctx->TransformFeedback.Objects, first + i, obj); + _mesa_HashInsertLocked(ctx->TransformFeedback.Objects, first + i, + obj); if (dsa) { /* this is normally done at bind time in the non-dsa case */ obj->EverBound = GL_TRUE; @@ -1132,7 +1133,7 @@ _mesa_DeleteTransformFeedbacks(GLsizei n, const GLuint *names) names[i]); return; } - _mesa_HashRemove(ctx->TransformFeedback.Objects, names[i]); + _mesa_HashRemoveLocked(ctx->TransformFeedback.Objects, names[i]); /* unref, but object may not be deleted until later */ if (obj == ctx->TransformFeedback.CurrentObject) { reference_transform_feedback_object( |