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
);
61 _mesa_init_memory_object_functions(struct dd_function_table
*driver
);
64 _mesa_initialize_memory_object(struct gl_context
*ctx
,
65 struct gl_memory_object
*obj
,
68 _mesa_delete_memory_object(struct gl_context
*ctx
, struct gl_memory_object
*mo
);
70 extern void GLAPIENTRY
71 _mesa_DeleteMemoryObjectsEXT(GLsizei n
, const GLuint
*memoryObjects
);
73 extern GLboolean GLAPIENTRY
74 _mesa_IsMemoryObjectEXT(GLuint memoryObject
);
76 extern void GLAPIENTRY
77 _mesa_CreateMemoryObjectsEXT(GLsizei n
, GLuint
*memoryObjects
);
79 extern void GLAPIENTRY
80 _mesa_MemoryObjectParameterivEXT(GLuint memoryObject
,
84 extern void GLAPIENTRY
85 _mesa_GetMemoryObjectParameterivEXT(GLuint memoryObject
,
89 extern void GLAPIENTRY
90 _mesa_TexStorageMem2DEXT(GLenum target
,
92 GLenum internalFormat
,
98 extern void GLAPIENTRY
99 _mesa_TexStorageMem2DMultisampleEXT(GLenum target
,
101 GLenum internalFormat
,
104 GLboolean fixedSampleLocations
,
108 extern void GLAPIENTRY
109 _mesa_TexStorageMem3DEXT(GLenum target
,
111 GLenum internalFormat
,
118 extern void GLAPIENTRY
119 _mesa_TexStorageMem3DMultisampleEXT(GLenum target
,
121 GLenum internalFormat
,
125 GLboolean fixedSampleLocations
,
129 extern void GLAPIENTRY
130 _mesa_TextureStorageMem2DEXT(GLuint texture
,
132 GLenum internalFormat
,
138 extern void GLAPIENTRY
139 _mesa_TextureStorageMem2DMultisampleEXT(GLuint texture
,
141 GLenum internalFormat
,
144 GLboolean fixedSampleLocations
,
148 extern void GLAPIENTRY
149 _mesa_TextureStorageMem3DEXT(GLuint texture
,
151 GLenum internalFormat
,
158 extern void GLAPIENTRY
159 _mesa_TextureStorageMem3DMultisampleEXT(GLuint texture
,
161 GLenum internalFormat
,
165 GLboolean fixedSampleLocations
,
169 extern void GLAPIENTRY
170 _mesa_TexStorageMem1DEXT(GLenum target
,
172 GLenum internalFormat
,
177 extern void GLAPIENTRY
178 _mesa_TextureStorageMem1DEXT(GLuint texture
,
180 GLenum internalFormat
,
185 extern void GLAPIENTRY
186 _mesa_GenSemaphoresEXT(GLsizei n
, GLuint
*semaphores
);
188 extern void GLAPIENTRY
189 _mesa_DeleteSemaphoresEXT(GLsizei n
, const GLuint
*semaphores
);
191 extern GLboolean GLAPIENTRY
192 _mesa_IsSemaphoreEXT(GLuint semaphore
);
194 extern void GLAPIENTRY
195 _mesa_SemaphoreParameterui64vEXT(GLuint semaphore
,
197 const GLuint64
*params
);
199 extern void GLAPIENTRY
200 _mesa_GetSemaphoreParameterui64vEXT(GLuint semaphore
,
204 extern void GLAPIENTRY
205 _mesa_WaitSemaphoreEXT(GLuint semaphore
,
206 GLuint numBufferBarriers
,
207 const GLuint
*buffers
,
208 GLuint numTextureBarriers
,
209 const GLuint
*textures
,
210 const GLenum
*srcLayouts
);
212 extern void GLAPIENTRY
213 _mesa_SignalSemaphoreEXT(GLuint semaphore
,
214 GLuint numBufferBarriers
,
215 const GLuint
*buffers
,
216 GLuint numTextureBarriers
,
217 const GLuint
*textures
,
218 const GLenum
*dstLayouts
);
220 extern void GLAPIENTRY
221 _mesa_ImportMemoryFdEXT(GLuint memory
,
226 extern void GLAPIENTRY
227 _mesa_ImportSemaphoreFdEXT(GLuint semaphore
,