32 #ifndef __OPENCL_CL_GL_H
33 #define __OPENCL_CL_GL_H
36 #include <OpenCL/cl.h>
37 #include <OpenGL/CGLDevice.h>
46 typedef cl_uint cl_gl_object_type;
47 typedef cl_uint cl_gl_texture_info;
48 typedef cl_uint cl_gl_platform_info;
49 typedef struct __GLsync *cl_GLsync;
52 #define CL_GL_OBJECT_BUFFER 0x2000
53 #define CL_GL_OBJECT_TEXTURE2D 0x2001
54 #define CL_GL_OBJECT_TEXTURE3D 0x2002
55 #define CL_GL_OBJECT_RENDERBUFFER 0x2003
58 #define CL_GL_TEXTURE_TARGET 0x2004
59 #define CL_GL_MIPMAP_LEVEL 0x2005
61 extern CL_API_ENTRY cl_mem CL_API_CALL
62 clCreateFromGLBuffer(cl_context ,
65 int * ) CL_API_SUFFIX__VERSION_1_0;
67 extern CL_API_ENTRY cl_mem CL_API_CALL
68 clCreateFromGLTexture2D(cl_context ,
73 cl_int * ) CL_API_SUFFIX__VERSION_1_0;
75 extern CL_API_ENTRY cl_mem CL_API_CALL
76 clCreateFromGLTexture3D(cl_context ,
81 cl_int * ) CL_API_SUFFIX__VERSION_1_0;
83 extern CL_API_ENTRY cl_mem CL_API_CALL
84 clCreateFromGLRenderbuffer(cl_context ,
87 cl_int * ) CL_API_SUFFIX__VERSION_1_0;
89 extern CL_API_ENTRY cl_int CL_API_CALL
90 clGetGLObjectInfo(cl_mem ,
92 cl_GLuint * ) CL_API_SUFFIX__VERSION_1_0;
94 extern CL_API_ENTRY cl_int CL_API_CALL
95 clGetGLTextureInfo(cl_mem ,
99 size_t * ) CL_API_SUFFIX__VERSION_1_0;
101 extern CL_API_ENTRY cl_int CL_API_CALL
102 clEnqueueAcquireGLObjects(cl_command_queue ,
107 cl_event * ) CL_API_SUFFIX__VERSION_1_0;
109 extern CL_API_ENTRY cl_int CL_API_CALL
110 clEnqueueReleaseGLObjects(cl_command_queue ,
115 cl_event * ) CL_API_SUFFIX__VERSION_1_0;
119 #define cl_khr_gl_sharing 1
121 typedef cl_uint cl_gl_context_info;
124 #define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
127 #define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
128 #define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
131 #define CL_GL_CONTEXT_KHR 0x2008
132 #define CL_EGL_DISPLAY_KHR 0x2009
133 #define CL_GLX_DISPLAY_KHR 0x200A
134 #define CL_WGL_HDC_KHR 0x200B
135 #define CL_CGL_SHAREGROUP_KHR 0x200C
137 extern CL_API_ENTRY cl_int CL_API_CALL
138 clGetGLContextInfoKHR(
const cl_context_properties * ,
142 size_t * ) CL_API_SUFFIX__VERSION_1_0;
144 typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
145 const cl_context_properties * properties,
146 cl_gl_context_info param_name,
147 size_t param_value_size,
149 size_t * param_value_size_ret);