• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Mesa 3-D graphics library
3  *
4  * Copyright (C) 2017 Red Hat.
5  *
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:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
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.
23  *
24  * Authors: Dave Airlie <airlied@gmail.com>
25  * 	    Andres Rodriguez <andresx7@gmail.com>
26  */
27 
28 /**
29  * \file externalobjects.h
30  *
31  * Declarations of functions related to the API interop extensions.
32  */
33 
34 #ifndef EXTERNALOBJECTS_H
35 #define EXTERNALOBJECTS_H
36 
37 #include "glheader.h"
38 #include "hash.h"
39 
40 static inline struct gl_memory_object *
_mesa_lookup_memory_object(struct gl_context * ctx,GLuint memory)41 _mesa_lookup_memory_object(struct gl_context *ctx, GLuint memory)
42 {
43    if (!memory)
44       return NULL;
45 
46    return (struct gl_memory_object *)
47       _mesa_HashLookup(ctx->Shared->MemoryObjects, memory);
48 }
49 
50 static inline struct gl_memory_object *
_mesa_lookup_memory_object_locked(struct gl_context * ctx,GLuint memory)51 _mesa_lookup_memory_object_locked(struct gl_context *ctx, GLuint memory)
52 {
53    if (!memory)
54       return NULL;
55 
56    return (struct gl_memory_object *)
57       _mesa_HashLookupLocked(ctx->Shared->MemoryObjects, memory);
58 }
59 
60 extern void
61 _mesa_init_memory_object_functions(struct dd_function_table *driver);
62 
63 extern void
64 _mesa_initialize_memory_object(struct gl_context *ctx,
65                                struct gl_memory_object *obj,
66                                GLuint name);
67 extern void
68 _mesa_delete_memory_object(struct gl_context *ctx, struct gl_memory_object *mo);
69 
70 extern void GLAPIENTRY
71 _mesa_DeleteMemoryObjectsEXT(GLsizei n, const GLuint *memoryObjects);
72 
73 extern GLboolean GLAPIENTRY
74 _mesa_IsMemoryObjectEXT(GLuint memoryObject);
75 
76 extern void GLAPIENTRY
77 _mesa_CreateMemoryObjectsEXT(GLsizei n, GLuint *memoryObjects);
78 
79 extern void GLAPIENTRY
80 _mesa_MemoryObjectParameterivEXT(GLuint memoryObject,
81                                  GLenum pname,
82                                  const GLint *params);
83 
84 extern void GLAPIENTRY
85 _mesa_GetMemoryObjectParameterivEXT(GLuint memoryObject,
86                                     GLenum pname,
87                                     GLint *params);
88 
89 extern void GLAPIENTRY
90 _mesa_TexStorageMem2DEXT(GLenum target,
91                          GLsizei levels,
92                          GLenum internalFormat,
93                          GLsizei width,
94                          GLsizei height,
95                          GLuint memory,
96                          GLuint64 offset);
97 
98 extern void GLAPIENTRY
99 _mesa_TexStorageMem2DMultisampleEXT(GLenum target,
100                                     GLsizei samples,
101                                     GLenum internalFormat,
102                                     GLsizei width,
103                                     GLsizei height,
104                                     GLboolean fixedSampleLocations,
105                                     GLuint memory,
106                                     GLuint64 offset);
107 
108 extern void GLAPIENTRY
109 _mesa_TexStorageMem3DEXT(GLenum target,
110                          GLsizei levels,
111                          GLenum internalFormat,
112                          GLsizei width,
113                          GLsizei height,
114                          GLsizei depth,
115                          GLuint memory,
116                          GLuint64 offset);
117 
118 extern void GLAPIENTRY
119 _mesa_TexStorageMem3DMultisampleEXT(GLenum target,
120                                     GLsizei samples,
121                                     GLenum internalFormat,
122                                     GLsizei width,
123                                     GLsizei height,
124                                     GLsizei depth,
125                                     GLboolean fixedSampleLocations,
126                                     GLuint memory,
127                                     GLuint64 offset);
128 
129 extern void GLAPIENTRY
130 _mesa_TextureStorageMem2DEXT(GLuint texture,
131                              GLsizei levels,
132                              GLenum internalFormat,
133                              GLsizei width,
134                              GLsizei height,
135                              GLuint memory,
136                              GLuint64 offset);
137 
138 extern void GLAPIENTRY
139 _mesa_TextureStorageMem2DMultisampleEXT(GLuint texture,
140                                         GLsizei samples,
141                                         GLenum internalFormat,
142                                         GLsizei width,
143                                         GLsizei height,
144                                         GLboolean fixedSampleLocations,
145                                         GLuint memory,
146                                         GLuint64 offset);
147 
148 extern void GLAPIENTRY
149 _mesa_TextureStorageMem3DEXT(GLuint texture,
150                              GLsizei levels,
151                              GLenum internalFormat,
152                              GLsizei width,
153                              GLsizei height,
154                              GLsizei depth,
155                              GLuint memory,
156                              GLuint64 offset);
157 
158 extern void GLAPIENTRY
159 _mesa_TextureStorageMem3DMultisampleEXT(GLuint texture,
160                                         GLsizei samples,
161                                         GLenum internalFormat,
162                                         GLsizei width,
163                                         GLsizei height,
164                                         GLsizei depth,
165                                         GLboolean fixedSampleLocations,
166                                         GLuint memory,
167                                         GLuint64 offset);
168 
169 extern void GLAPIENTRY
170 _mesa_TexStorageMem1DEXT(GLenum target,
171                          GLsizei levels,
172                          GLenum internalFormat,
173                          GLsizei width,
174                          GLuint memory,
175                          GLuint64 offset);
176 
177 extern void GLAPIENTRY
178 _mesa_TextureStorageMem1DEXT(GLuint texture,
179                              GLsizei levels,
180                              GLenum internalFormat,
181                              GLsizei width,
182                              GLuint memory,
183                              GLuint64 offset);
184 
185 extern void GLAPIENTRY
186 _mesa_GenSemaphoresEXT(GLsizei n, GLuint *semaphores);
187 
188 extern void GLAPIENTRY
189 _mesa_DeleteSemaphoresEXT(GLsizei n, const GLuint *semaphores);
190 
191 extern GLboolean GLAPIENTRY
192 _mesa_IsSemaphoreEXT(GLuint semaphore);
193 
194 extern void GLAPIENTRY
195 _mesa_SemaphoreParameterui64vEXT(GLuint semaphore,
196                                  GLenum pname,
197                                  const GLuint64 *params);
198 
199 extern void GLAPIENTRY
200 _mesa_GetSemaphoreParameterui64vEXT(GLuint semaphore,
201                                     GLenum pname,
202                                     GLuint64 *params);
203 
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);
211 
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);
219 
220 extern void GLAPIENTRY
221 _mesa_ImportMemoryFdEXT(GLuint memory,
222                         GLuint64 size,
223                         GLenum handleType,
224                         GLint fd);
225 
226 extern void GLAPIENTRY
227 _mesa_ImportSemaphoreFdEXT(GLuint semaphore,
228                            GLenum handleType,
229                            GLint fd);
230 
231 #endif
232