diff options
author | Andres Rodriguez <[email protected]> | 2017-10-06 17:17:54 -0400 |
---|---|---|
committer | Andres Rodriguez <[email protected]> | 2018-01-30 15:13:49 -0500 |
commit | 67d5d08682c4975a025182a7bf58a4768753e677 (patch) | |
tree | bfca34272dd4eee12b89e32dfedbe4169b8d1df7 /src/mesa/main/externalobjects.h | |
parent | 8e635f7d65752cd5af362036fd50ff3957275510 (diff) |
mesa: add support for semaphore object creation/import/delete v3
Used by EXT_semmaphore and EXT_semaphore_fd
v2: Removed unnecessary dummy callback initialization
v3: Fixed attempting to free the DummySemaphoreObject
Signed-off-by: Andres Rodriguez <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/externalobjects.h')
-rw-r--r-- | src/mesa/main/externalobjects.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/mesa/main/externalobjects.h b/src/mesa/main/externalobjects.h index a9a12b821f7..75b0bc2eddb 100644 --- a/src/mesa/main/externalobjects.h +++ b/src/mesa/main/externalobjects.h @@ -57,6 +57,26 @@ _mesa_lookup_memory_object_locked(struct gl_context *ctx, GLuint memory) _mesa_HashLookupLocked(ctx->Shared->MemoryObjects, memory); } +static inline struct gl_semaphore_object * +_mesa_lookup_semaphore_object(struct gl_context *ctx, GLuint semaphore) +{ + if (!semaphore) + return NULL; + + return (struct gl_semaphore_object *) + _mesa_HashLookup(ctx->Shared->SemaphoreObjects, semaphore); +} + +static inline struct gl_semaphore_object * +_mesa_lookup_semaphore_object_locked(struct gl_context *ctx, GLuint semaphore) +{ + if (!semaphore) + return NULL; + + return (struct gl_semaphore_object *) + _mesa_HashLookupLocked(ctx->Shared->SemaphoreObjects, semaphore); +} + extern void _mesa_init_memory_object_functions(struct dd_function_table *driver); @@ -65,7 +85,16 @@ _mesa_initialize_memory_object(struct gl_context *ctx, struct gl_memory_object *obj, GLuint name); extern void -_mesa_delete_memory_object(struct gl_context *ctx, struct gl_memory_object *mo); +_mesa_delete_memory_object(struct gl_context *ctx, + struct gl_memory_object *semObj); + +extern void +_mesa_initialize_semaphore_object(struct gl_context *ctx, + struct gl_semaphore_object *obj, + GLuint name); +extern void +_mesa_delete_semaphore_object(struct gl_context *ctx, + struct gl_semaphore_object *semObj); extern void GLAPIENTRY _mesa_DeleteMemoryObjectsEXT(GLsizei n, const GLuint *memoryObjects); |