summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pipelineobj.c
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2017-04-21 13:48:38 +1000
committerTimothy Arceri <[email protected]>2017-04-22 10:01:15 +1000
commit0b2750620b65f9a5fd56ed857ddfef5fafec0894 (patch)
tree34fbc1e49c540c7ddddd554a1b9ccee5e878cc03 /src/mesa/main/pipelineobj.c
parent622a68ed3e36a6b56db35df62c5913d2d54d5ed6 (diff)
mesa: Remove unnecessary locking from container objects.
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. V2: (Timothy Arceri) - rebased and dropped changes to framebuffer objects Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/mesa/main/pipelineobj.c')
-rw-r--r--src/mesa/main/pipelineobj.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index 2988c97455e..a0fa55a85c4 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -66,7 +66,6 @@ _mesa_delete_pipeline_object(struct gl_context *ctx,
}
_mesa_reference_shader_program(ctx, &obj->ActiveProgram, NULL);
- mtx_destroy(&obj->Mutex);
free(obj->Label);
ralloc_free(obj);
}
@@ -80,7 +79,6 @@ _mesa_new_pipeline_object(struct gl_context *ctx, GLuint name)
struct gl_pipeline_object *obj = rzalloc(NULL, struct gl_pipeline_object);
if (obj) {
obj->Name = name;
- mtx_init(&obj->Mutex, mtx_plain);
obj->RefCount = 1;
obj->Flags = _mesa_get_shader_flags();
obj->InfoLog = NULL;
@@ -189,11 +187,9 @@ _mesa_reference_pipeline_object_(struct gl_context *ctx,
GLboolean deleteFlag = GL_FALSE;
struct gl_pipeline_object *oldObj = *ptr;
- mtx_lock(&oldObj->Mutex);
assert(oldObj->RefCount > 0);
oldObj->RefCount--;
deleteFlag = (oldObj->RefCount == 0);
- mtx_unlock(&oldObj->Mutex);
if (deleteFlag) {
_mesa_delete_pipeline_object(ctx, oldObj);
@@ -205,12 +201,10 @@ _mesa_reference_pipeline_object_(struct gl_context *ctx,
if (obj) {
/* reference new pipeline object */
- mtx_lock(&obj->Mutex);
assert(obj->RefCount > 0);
obj->RefCount++;
*ptr = obj;
- mtx_unlock(&obj->Mutex);
}
}