blob: f88348e25a42e439220688569941691e82ce9e96 [file] [log] [blame]
Sheri Zhang79cb9452021-09-07 14:51:49 +01001/*******************************************************************************
Viet-Hoa Do633ebd12023-08-11 12:27:59 +01002 * Copyright (c) 2008-2023 The Khronos Group Inc.
Anthony Barbier6ff3b192017-09-04 18:44:23 +01003 *
Sheri Zhang79cb9452021-09-07 14:51:49 +01004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Anthony Barbier6ff3b192017-09-04 18:44:23 +01007 *
Sheri Zhang79cb9452021-09-07 14:51:49 +01008 * http://www.apache.org/licenses/LICENSE-2.0
Anthony Barbier6ff3b192017-09-04 18:44:23 +01009 *
Sheri Zhang79cb9452021-09-07 14:51:49 +010010 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ******************************************************************************/
Anthony Barbier6ff3b192017-09-04 18:44:23 +010016
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010017#ifndef OPENCL_CL_GL_H_
18#define OPENCL_CL_GL_H_
19
20/*
21** This header is generated from the Khronos OpenCL XML API Registry.
22*/
Anthony Barbier6ff3b192017-09-04 18:44:23 +010023
Anthony Barbier6ff3b192017-09-04 18:44:23 +010024#include <CL/cl.h>
Anthony Barbier6ff3b192017-09-04 18:44:23 +010025
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010026/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */
27#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES)
28#define CL_NO_EXTENSION_PROTOTYPES
29#endif
30
31/* CL_NO_EXTENSION_PROTOTYPES implies
32 CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and
33 CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */
34#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
35 !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
36#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES
37#endif
38#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
39 !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
40#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES
41#endif
42
Anthony Barbier6ff3b192017-09-04 18:44:23 +010043#ifdef __cplusplus
44extern "C" {
45#endif
46
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010047/***************************************************************
48* cl_khr_gl_sharing
49***************************************************************/
Anthony Barbier6ff3b192017-09-04 18:44:23 +010050#define cl_khr_gl_sharing 1
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010051#define CL_KHR_GL_SHARING_EXTENSION_NAME \
52 "cl_khr_gl_sharing"
Sheri Zhang67354e02021-06-30 16:08:29 +010053
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010054typedef cl_uint cl_gl_context_info;
Sheri Zhang67354e02021-06-30 16:08:29 +010055
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010056/* Error codes */
57#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
Sheri Zhang67354e02021-06-30 16:08:29 +010058
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010059/* cl_gl_context_info */
60#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
61#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
Sheri Zhang67354e02021-06-30 16:08:29 +010062
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010063/* Additional cl_context_properties */
64#define CL_GL_CONTEXT_KHR 0x2008
65#define CL_EGL_DISPLAY_KHR 0x2009
66#define CL_GLX_DISPLAY_KHR 0x200A
67#define CL_WGL_HDC_KHR 0x200B
68#define CL_CGL_SHAREGROUP_KHR 0x200C
69
70typedef cl_uint cl_gl_object_type;
71typedef cl_uint cl_gl_texture_info;
72typedef cl_uint cl_gl_platform_info;
73
74/* cl_gl_object_type */
75#define CL_GL_OBJECT_BUFFER 0x2000
76#define CL_GL_OBJECT_TEXTURE2D 0x2001
77#define CL_GL_OBJECT_TEXTURE3D 0x2002
78#define CL_GL_OBJECT_RENDERBUFFER 0x2003
79
80#if defined(CL_VERSION_1_2)
81/* cl_gl_object_type */
82#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E
83#define CL_GL_OBJECT_TEXTURE1D 0x200F
84#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010
85#define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011
86
87#endif /* defined(CL_VERSION_1_2) */
88
89/* cl_gl_texture_info */
90#define CL_GL_TEXTURE_TARGET 0x2004
91#define CL_GL_MIPMAP_LEVEL 0x2005
92
93
94typedef cl_int (CL_API_CALL *
95clGetGLContextInfoKHR_fn)(
96 const cl_context_properties* properties,
97 cl_gl_context_info param_name,
98 size_t param_value_size,
99 void* param_value,
100 size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
101
102typedef cl_mem (CL_API_CALL *
103clCreateFromGLBuffer_fn)(
104 cl_context context,
105 cl_mem_flags flags,
106 cl_GLuint bufobj,
107 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
108
109#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
Sheri Zhang67354e02021-06-30 16:08:29 +0100110
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100111extern CL_API_ENTRY cl_int CL_API_CALL
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100112clGetGLContextInfoKHR(
113 const cl_context_properties* properties,
114 cl_gl_context_info param_name,
115 size_t param_value_size,
116 void* param_value,
117 size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
Sheri Zhang67354e02021-06-30 16:08:29 +0100118
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100119extern CL_API_ENTRY cl_mem CL_API_CALL
120clCreateFromGLBuffer(
121 cl_context context,
122 cl_mem_flags flags,
123 cl_GLuint bufobj,
124 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100125
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100126#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
127
128#if defined(CL_VERSION_1_2)
129
130typedef cl_mem (CL_API_CALL *
131clCreateFromGLTexture_fn)(
132 cl_context context,
133 cl_mem_flags flags,
134 cl_GLenum target,
135 cl_GLint miplevel,
136 cl_GLuint texture,
137 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
138
139#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
140
141extern CL_API_ENTRY cl_mem CL_API_CALL
142clCreateFromGLTexture(
143 cl_context context,
144 cl_mem_flags flags,
145 cl_GLenum target,
146 cl_GLint miplevel,
147 cl_GLuint texture,
148 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
149
150#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
151
152#endif /* defined(CL_VERSION_1_2) */
153
154
155typedef cl_mem (CL_API_CALL *
156clCreateFromGLRenderbuffer_fn)(
157 cl_context context,
158 cl_mem_flags flags,
159 cl_GLuint renderbuffer,
160 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
161
162typedef cl_int (CL_API_CALL *
163clGetGLObjectInfo_fn)(
164 cl_mem memobj,
165 cl_gl_object_type* gl_object_type,
166 cl_GLuint* gl_object_name) CL_API_SUFFIX__VERSION_1_0;
167
168typedef cl_int (CL_API_CALL *
169clGetGLTextureInfo_fn)(
170 cl_mem memobj,
171 cl_gl_texture_info param_name,
172 size_t param_value_size,
173 void* param_value,
174 size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
175
176typedef cl_int (CL_API_CALL *
177clEnqueueAcquireGLObjects_fn)(
178 cl_command_queue command_queue,
179 cl_uint num_objects,
180 const cl_mem* mem_objects,
181 cl_uint num_events_in_wait_list,
182 const cl_event* event_wait_list,
183 cl_event* event) CL_API_SUFFIX__VERSION_1_0;
184
185typedef cl_int (CL_API_CALL *
186clEnqueueReleaseGLObjects_fn)(
187 cl_command_queue command_queue,
188 cl_uint num_objects,
189 const cl_mem* mem_objects,
190 cl_uint num_events_in_wait_list,
191 const cl_event* event_wait_list,
192 cl_event* event) CL_API_SUFFIX__VERSION_1_0;
193
194#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
195
196extern CL_API_ENTRY cl_mem CL_API_CALL
197clCreateFromGLRenderbuffer(
198 cl_context context,
199 cl_mem_flags flags,
200 cl_GLuint renderbuffer,
201 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
202
203extern CL_API_ENTRY cl_int CL_API_CALL
204clGetGLObjectInfo(
205 cl_mem memobj,
206 cl_gl_object_type* gl_object_type,
207 cl_GLuint* gl_object_name) CL_API_SUFFIX__VERSION_1_0;
208
209extern CL_API_ENTRY cl_int CL_API_CALL
210clGetGLTextureInfo(
211 cl_mem memobj,
212 cl_gl_texture_info param_name,
213 size_t param_value_size,
214 void* param_value,
215 size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
216
217extern CL_API_ENTRY cl_int CL_API_CALL
218clEnqueueAcquireGLObjects(
219 cl_command_queue command_queue,
220 cl_uint num_objects,
221 const cl_mem* mem_objects,
222 cl_uint num_events_in_wait_list,
223 const cl_event* event_wait_list,
224 cl_event* event) CL_API_SUFFIX__VERSION_1_0;
225
226extern CL_API_ENTRY cl_int CL_API_CALL
227clEnqueueReleaseGLObjects(
228 cl_command_queue command_queue,
229 cl_uint num_objects,
230 const cl_mem* mem_objects,
231 cl_uint num_events_in_wait_list,
232 const cl_event* event_wait_list,
233 cl_event* event) CL_API_SUFFIX__VERSION_1_0;
234
235#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
236
237/* OpenCL 1.0 APIs that were deprecated in OpenCL 1.2 */
238
239typedef cl_mem (CL_API_CALL *
240clCreateFromGLTexture2D_fn)(
241 cl_context context,
242 cl_mem_flags flags,
243 cl_GLenum target,
244 cl_GLint miplevel,
245 cl_GLuint texture,
246 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
247
248typedef cl_mem (CL_API_CALL *
249clCreateFromGLTexture3D_fn)(
250 cl_context context,
251 cl_mem_flags flags,
252 cl_GLenum target,
253 cl_GLint miplevel,
254 cl_GLuint texture,
255 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
256
257#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
258
259extern CL_API_ENTRY cl_mem CL_API_CALL
260clCreateFromGLTexture2D(
261 cl_context context,
262 cl_mem_flags flags,
263 cl_GLenum target,
264 cl_GLint miplevel,
265 cl_GLuint texture,
266 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
267
268extern CL_API_ENTRY cl_mem CL_API_CALL
269clCreateFromGLTexture3D(
270 cl_context context,
271 cl_mem_flags flags,
272 cl_GLenum target,
273 cl_GLint miplevel,
274 cl_GLuint texture,
275 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
276
277#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
278
279/***************************************************************
280* cl_khr_gl_event
281***************************************************************/
282#define cl_khr_gl_event 1
283#define CL_KHR_GL_EVENT_EXTENSION_NAME \
284 "cl_khr_gl_event"
285
286typedef struct __GLsync * cl_GLsync;
287
288/* cl_command_type */
289#define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D
290
291
292typedef cl_event (CL_API_CALL *
293clCreateEventFromGLsyncKHR_fn)(
294 cl_context context,
295 cl_GLsync sync,
296 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1;
297
298#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +0000299
300extern CL_API_ENTRY cl_event CL_API_CALL
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100301clCreateEventFromGLsyncKHR(
302 cl_context context,
303 cl_GLsync sync,
304 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1;
305
306#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
307
308/***************************************************************
309* cl_khr_gl_depth_images
310***************************************************************/
311#define cl_khr_gl_depth_images 1
312#define CL_KHR_GL_DEPTH_IMAGES_EXTENSION_NAME \
313 "cl_khr_gl_depth_images"
314
315#if !defined(CL_VERSION_1_2)
316/* cl_channel_order - defined in CL.h for OpenCL 1.2 and newer */
317#define CL_DEPTH_STENCIL 0x10BE
318
319#endif /* !defined(CL_VERSION_1_2) */
320
321#if !defined(CL_VERSION_1_2)
322/* cl_channel_type - defined in CL.h for OpenCL 1.2 and newer */
323#define CL_UNORM_INT24 0x10DF
324
325#endif /* !defined(CL_VERSION_1_2) */
326
327/***************************************************************
328* cl_khr_gl_msaa_sharing
329***************************************************************/
330#define cl_khr_gl_msaa_sharing 1
331#define CL_KHR_GL_MSAA_SHARING_EXTENSION_NAME \
332 "cl_khr_gl_msaa_sharing"
333
334/* cl_gl_texture_info */
335#define CL_GL_NUM_SAMPLES 0x2012
336
337/***************************************************************
338* cl_intel_sharing_format_query_gl
339***************************************************************/
340#define cl_intel_sharing_format_query_gl 1
341#define CL_INTEL_SHARING_FORMAT_QUERY_GL_EXTENSION_NAME \
342 "cl_intel_sharing_format_query_gl"
343
344/* when cl_khr_gl_sharing is supported */
345
346typedef cl_int (CL_API_CALL *
347clGetSupportedGLTextureFormatsINTEL_fn)(
348 cl_context context,
349 cl_mem_flags flags,
350 cl_mem_object_type image_type,
351 cl_uint num_entries,
352 cl_GLenum* gl_formats,
353 cl_uint* num_texture_formats) ;
354
355#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
356
357extern CL_API_ENTRY cl_int CL_API_CALL
358clGetSupportedGLTextureFormatsINTEL(
359 cl_context context,
360 cl_mem_flags flags,
361 cl_mem_object_type image_type,
362 cl_uint num_entries,
363 cl_GLenum* gl_formats,
364 cl_uint* num_texture_formats) ;
365
366#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +0000367
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100368#ifdef __cplusplus
369}
370#endif
371
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100372#endif /* OPENCL_CL_GL_H_ */