HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cl_gl.h
Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2008 - 2012 The Khronos Group Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and/or associated documentation files (the
6  * "Materials"), to deal in the Materials without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Materials, and to
9  * permit persons to whom the Materials are furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Materials.
14  *
15  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
22  **********************************************************************************/
23 
24 #ifndef __OPENCL_CL_GL_H
25 #define __OPENCL_CL_GL_H
26 
27 #ifdef __APPLE__
28 #include <OpenCL/cl.h>
29 #else
30 #include <CL/cl.h>
31 #endif
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 typedef cl_uint cl_gl_object_type;
38 typedef cl_uint cl_gl_texture_info;
39 typedef cl_uint cl_gl_platform_info;
40 typedef struct __GLsync *cl_GLsync;
41 
42 /* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */
43 #define CL_GL_OBJECT_BUFFER 0x2000
44 #define CL_GL_OBJECT_TEXTURE2D 0x2001
45 #define CL_GL_OBJECT_TEXTURE3D 0x2002
46 #define CL_GL_OBJECT_RENDERBUFFER 0x2003
47 #define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E
48 #define CL_GL_OBJECT_TEXTURE1D 0x200F
49 #define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010
50 #define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011
51 
52 /* cl_gl_texture_info */
53 #define CL_GL_TEXTURE_TARGET 0x2004
54 #define CL_GL_MIPMAP_LEVEL 0x2005
55 #define CL_GL_NUM_SAMPLES 0x2012
56 
57 
59 clCreateFromGLBuffer(cl_context /* context */,
60  cl_mem_flags /* flags */,
61  cl_GLuint /* bufobj */,
62  int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
63 
65 clCreateFromGLTexture(cl_context /* context */,
66  cl_mem_flags /* flags */,
67  cl_GLenum /* target */,
68  cl_GLint /* miplevel */,
69  cl_GLuint /* texture */,
70  cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
71 
73 clCreateFromGLRenderbuffer(cl_context /* context */,
74  cl_mem_flags /* flags */,
75  cl_GLuint /* renderbuffer */,
76  cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
77 
78 extern CL_API_ENTRY cl_int CL_API_CALL
79 clGetGLObjectInfo(cl_mem /* memobj */,
80  cl_gl_object_type * /* gl_object_type */,
81  cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
82 
83 extern CL_API_ENTRY cl_int CL_API_CALL
84 clGetGLTextureInfo(cl_mem /* memobj */,
85  cl_gl_texture_info /* param_name */,
86  size_t /* param_value_size */,
87  void * /* param_value */,
88  size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
89 
90 extern CL_API_ENTRY cl_int CL_API_CALL
92  cl_uint /* num_objects */,
93  const cl_mem * /* mem_objects */,
94  cl_uint /* num_events_in_wait_list */,
95  const cl_event * /* event_wait_list */,
96  cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
97 
98 extern CL_API_ENTRY cl_int CL_API_CALL
99 clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */,
100  cl_uint /* num_objects */,
101  const cl_mem * /* mem_objects */,
102  cl_uint /* num_events_in_wait_list */,
103  const cl_event * /* event_wait_list */,
104  cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
105 
106 
107 /* Deprecated OpenCL 1.1 APIs */
109 clCreateFromGLTexture2D(cl_context /* context */,
110  cl_mem_flags /* flags */,
111  cl_GLenum /* target */,
112  cl_GLint /* miplevel */,
113  cl_GLuint /* texture */,
114  cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
115 
117 clCreateFromGLTexture3D(cl_context /* context */,
118  cl_mem_flags /* flags */,
119  cl_GLenum /* target */,
120  cl_GLint /* miplevel */,
121  cl_GLuint /* texture */,
122  cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
123 
124 /* cl_khr_gl_sharing extension */
125 
126 #define cl_khr_gl_sharing 1
127 
128 typedef cl_uint cl_gl_context_info;
129 
130 /* Additional Error Codes */
131 #define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
132 
133 /* cl_gl_context_info */
134 #define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
135 #define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
136 
137 /* Additional cl_context_properties */
138 #define CL_GL_CONTEXT_KHR 0x2008
139 #define CL_EGL_DISPLAY_KHR 0x2009
140 #define CL_GLX_DISPLAY_KHR 0x200A
141 #define CL_WGL_HDC_KHR 0x200B
142 #define CL_CGL_SHAREGROUP_KHR 0x200C
143 
144 extern CL_API_ENTRY cl_int CL_API_CALL
145 clGetGLContextInfoKHR(const cl_context_properties * /* properties */,
146  cl_gl_context_info /* param_name */,
147  size_t /* param_value_size */,
148  void * /* param_value */,
149  size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
150 
152  const cl_context_properties * properties,
153  cl_gl_context_info param_name,
154  size_t param_value_size,
155  void * param_value,
156  size_t * param_value_size_ret);
157 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #endif /* __OPENCL_CL_GL_H */
cl_uint cl_gl_texture_info
Definition: cl_gl.h:38
struct _cl_context * cl_context
Definition: cl.h:41
CL_API_ENTRY cl_int CL_API_CALL clGetGLObjectInfo(cl_mem, cl_gl_object_type *, cl_GLuint *) CL_API_SUFFIX__VERSION_1_0
cl_uint cl_gl_platform_info
Definition: cl_gl.h:39
CL_API_ENTRY cl_mem CL_API_CALL clCreateFromGLRenderbuffer(cl_context, cl_mem_flags, cl_GLuint, cl_int *) CL_API_SUFFIX__VERSION_1_0
CL_API_ENTRY cl_int CL_API_CALL clGetGLTextureInfo(cl_mem, cl_gl_texture_info, size_t, void *, size_t *) CL_API_SUFFIX__VERSION_1_0
unsigned int cl_GLenum
Definition: cl_platform.h:314
#define CL_API_SUFFIX__VERSION_1_2
Definition: cl_platform.h:76
#define CL_API_ENTRY
Definition: cl_platform.h:43
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
Definition: cl_platform.h:115
unsigned int cl_GLuint
Definition: cl_platform.h:312
CL_API_ENTRY cl_mem CL_API_CALL clCreateFromGLTexture(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *) CL_API_SUFFIX__VERSION_1_2
CL_API_ENTRY cl_mem CL_API_CALL clCreateFromGLBuffer(cl_context, cl_mem_flags, cl_GLuint, int *) CL_API_SUFFIX__VERSION_1_0
CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL clCreateFromGLTexture2D(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
CL_API_ENTRY cl_int CL_API_CALL clEnqueueReleaseGLObjects(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) CL_API_SUFFIX__VERSION_1_0
struct _cl_mem * cl_mem
Definition: cl.h:43
intptr_t cl_context_properties
Definition: cl.h:62
struct _cl_event * cl_event
Definition: cl.h:46
CL_API_ENTRY cl_int(CL_API_CALL * clGetGLContextInfoKHR_fn)(const cl_context_properties *properties, cl_gl_context_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: cl_gl.h:151
CL_API_ENTRY cl_int CL_API_CALL clGetGLContextInfoKHR(const cl_context_properties *, cl_gl_context_info, size_t, void *, size_t *) CL_API_SUFFIX__VERSION_1_0
struct _cl_command_queue * cl_command_queue
Definition: cl.h:42
struct __GLsync * cl_GLsync
Definition: cl_gl.h:40
CL_API_ENTRY cl_int CL_API_CALL clEnqueueAcquireGLObjects(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) CL_API_SUFFIX__VERSION_1_0
#define CL_API_SUFFIX__VERSION_1_0
Definition: cl_platform.h:72
#define CL_API_CALL
Definition: cl_platform.h:44
#define const
Definition: zconf.h:214
CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL clCreateFromGLTexture3D(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int *) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
int cl_GLint
Definition: cl_platform.h:313
cl_uint cl_gl_context_info
Definition: cl_gl.h:128
cl_uint cl_gl_object_type
Definition: cl_gl.h:37
cl_bitfield cl_mem_flags
Definition: cl.h:67
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
Definition: cl_platform.h:116