diff options
author | Andres Rodriguez <[email protected]> | 2017-07-12 18:45:07 -0400 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-08-06 12:42:06 +1000 |
commit | 8b7c5744791fe403375dd1d61c4a99b882044415 (patch) | |
tree | ec5728914a1f98d8d55c9919d304f479e225481e /src/mesa/main/dd.h | |
parent | 322ee1b3636a38c22bc65009f13667a9d5f438cf (diff) |
mesa: add support for memory object creation/import/delete
Used by EXT_external_objects and EXT_external_objects_fd
V2 (Timothy Arceri):
- Throw GL_OUT_OF_MEMORY error if CreateMemoryObjectsEXT()
fails.
- C99 tidy ups
- remove void cast (Constantine Kharlamov)
V3 (Timothy Arceri):
- rename mo -> memObj
- check that the object is not NULL before initializing
- add missing "EXT" in function error message
V4 (Timothy Arceri):
- remove checks for (memory objecy id == 0) and catch in
_mesa_lookup_memory_object() instead.
Signed-off-by: Andres Rodriguez <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/mesa/main/dd.h')
-rw-r--r-- | src/mesa/main/dd.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 462829d755d..6d6bdecb4dd 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -1069,6 +1069,42 @@ struct dd_function_table { void (*MakeImageHandleResident)(struct gl_context *ctx, GLuint64 handle, GLenum access, bool resident); /*@}*/ + + + /** + * \name GL_EXT_external_objects interface + */ + /*@{*/ + /** + * Called to allocate a new memory object. Drivers will usually + * allocate/return a subclass of gl_memory_object. + */ + struct gl_memory_object * (*NewMemoryObject)(struct gl_context *ctx, + GLuint name); + /** + * Called to delete/free a memory object. Drivers should free the + * object and any image data it contains. + */ + void (*DeleteMemoryObject)(struct gl_context *ctx, + struct gl_memory_object *memObj); + /*@}*/ + + /** + * \name GL_EXT_external_objects_fd interface + */ + /*@{*/ + /** + * Called to import a memory object. The caller relinquishes ownership + * of fd after the call returns. + * + * Accessing fd after ImportMemoryObjectFd returns results in undefined + * behaviour. This is consistent with EXT_external_object_fd. + */ + void (*ImportMemoryObjectFd)(struct gl_context *ctx, + struct gl_memory_object *memObj, + GLuint64 size, + int fd); + /*@}*/ }; |