2 * Mesa 3-D graphics library
4 * Copyright (C) 2017 Red Hat.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
24 * Authors: Dave Airlie <airlied@gmail.com>
25 * Andres Rodriguez <andresx7@gmail.com>
29 * \file externalobjects.h
31 * Declarations of functions related to the API interop extensions.
34 #ifndef EXTERNALOBJECTS_H
35 #define EXTERNALOBJECTS_H
40 static inline struct gl_memory_object
*
41 _mesa_lookup_memory_object(struct gl_context
*ctx
, GLuint memory
)
46 return (struct gl_memory_object
*)
47 _mesa_HashLookup(ctx
->Shared
->MemoryObjects
, memory
);
50 static inline struct gl_memory_object
*
51 _mesa_lookup_memory_object_locked(struct gl_context
*ctx
, GLuint memory
)
56 return (struct gl_memory_object
*)
57 _mesa_HashLookupLocked(ctx
->Shared
->MemoryObjects
, memory
);
60 static inline struct gl_semaphore_object
*
61 _mesa_lookup_semaphore_object(struct gl_context
*ctx
, GLuint semaphore
)
66 return (struct gl_semaphore_object
*)
67 _mesa_HashLookup(ctx
->Shared
->SemaphoreObjects
, semaphore
);
70 static inline struct gl_semaphore_object
*
71 _mesa_lookup_semaphore_object_locked(struct gl_context
*ctx
, GLuint semaphore
)
76 return (struct gl_semaphore_object
*)
77 _mesa_HashLookupLocked(ctx
->Shared
->SemaphoreObjects
, semaphore
);
81 _mesa_init_memory_object_functions(struct dd_function_table
*driver
);
84 _mesa_initialize_memory_object(struct gl_context
*ctx
,
85 struct gl_memory_object
*obj
,
88 _mesa_delete_memory_object(struct gl_context
*ctx
,
89 struct gl_memory_object
*semObj
);
92 _mesa_initialize_semaphore_object(struct gl_context
*ctx
,
93 struct gl_semaphore_object
*obj
,
96 _mesa_delete_semaphore_object(struct gl_context
*ctx
,
97 struct gl_semaphore_object
*semObj
);
99 extern void GLAPIENTRY
100 _mesa_DeleteMemoryObjectsEXT(GLsizei n
, const GLuint
*memoryObjects
);
102 extern GLboolean GLAPIENTRY
103 _mesa_IsMemoryObjectEXT(GLuint memoryObject
);
105 extern void GLAPIENTRY
106 _mesa_CreateMemoryObjectsEXT(GLsizei n
, GLuint
*memoryObjects
);
108 extern void GLAPIENTRY
109 _mesa_MemoryObjectParameterivEXT(GLuint memoryObject
,
111 const GLint
*params
);
113 extern void GLAPIENTRY
114 _mesa_GetMemoryObjectParameterivEXT(GLuint memoryObject
,
118 extern void GLAPIENTRY
119 _mesa_TexStorageMem2DEXT(GLenum target
,
121 GLenum internalFormat
,
127 extern void GLAPIENTRY
128 _mesa_TexStorageMem2DMultisampleEXT(GLenum target
,
130 GLenum internalFormat
,
133 GLboolean fixedSampleLocations
,
137 extern void GLAPIENTRY
138 _mesa_TexStorageMem3DEXT(GLenum target
,
140 GLenum internalFormat
,
147 extern void GLAPIENTRY
148 _mesa_TexStorageMem3DMultisampleEXT(GLenum target
,
150 GLenum internalFormat
,
154 GLboolean fixedSampleLocations
,
158 extern void GLAPIENTRY
159 _mesa_TextureStorageMem2DEXT(GLuint texture
,
161 GLenum internalFormat
,
167 extern void GLAPIENTRY
168 _mesa_TextureStorageMem2DMultisampleEXT(GLuint texture
,
170 GLenum internalFormat
,
173 GLboolean fixedSampleLocations
,
177 extern void GLAPIENTRY
178 _mesa_TextureStorageMem3DEXT(GLuint texture
,
180 GLenum internalFormat
,
187 extern void GLAPIENTRY
188 _mesa_TextureStorageMem3DMultisampleEXT(GLuint texture
,
190 GLenum internalFormat
,
194 GLboolean fixedSampleLocations
,
198 extern void GLAPIENTRY
199 _mesa_TexStorageMem1DEXT(GLenum target
,
201 GLenum internalFormat
,
206 extern void GLAPIENTRY
207 _mesa_TextureStorageMem1DEXT(GLuint texture
,
209 GLenum internalFormat
,
214 extern void GLAPIENTRY
215 _mesa_GenSemaphoresEXT(GLsizei n
, GLuint
*semaphores
);
217 extern void GLAPIENTRY
218 _mesa_DeleteSemaphoresEXT(GLsizei n
, const GLuint
*semaphores
);
220 extern GLboolean GLAPIENTRY
221 _mesa_IsSemaphoreEXT(GLuint semaphore
);
223 extern void GLAPIENTRY
224 _mesa_SemaphoreParameterui64vEXT(GLuint semaphore
,
226 const GLuint64
*params
);
228 extern void GLAPIENTRY
229 _mesa_GetSemaphoreParameterui64vEXT(GLuint semaphore
,
233 extern void GLAPIENTRY
234 _mesa_WaitSemaphoreEXT(GLuint semaphore
,
235 GLuint numBufferBarriers
,
236 const GLuint
*buffers
,
237 GLuint numTextureBarriers
,
238 const GLuint
*textures
,
239 const GLenum
*srcLayouts
);
241 extern void GLAPIENTRY
242 _mesa_SignalSemaphoreEXT(GLuint semaphore
,
243 GLuint numBufferBarriers
,
244 const GLuint
*buffers
,
245 GLuint numTextureBarriers
,
246 const GLuint
*textures
,
247 const GLenum
*dstLayouts
);
249 extern void GLAPIENTRY
250 _mesa_ImportMemoryFdEXT(GLuint memory
,
255 extern void GLAPIENTRY
256 _mesa_ImportSemaphoreFdEXT(GLuint semaphore
,