1
/**********************************************************************************
2
* Copyright (c) 2008-2009 The Khronos Group Inc.
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:
12
* The above copyright notice and this permission notice shall be included
13
* in all copies or substantial portions of the Materials.
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
**********************************************************************************/
24
/* $Revision: 10327 $ on $Date: 2010-02-11 00:24:35 +0530 (Thu, 11 Feb 2010) $ */
27
* cl_gl.h contains Khronos-approved (KHR) OpenCL extensions which have
28
* OpenGL dependencies. The application is responsible for #including
29
* OpenGL or OpenGL ES headers before #including cl_gl.h.
32
#ifndef __OPENCL_CL_GL_H
33
#define __OPENCL_CL_GL_H
36
#include <OpenCL/cl.h>
45
typedef cl_uint cl_gl_object_type;
46
typedef cl_uint cl_gl_texture_info;
47
typedef cl_uint cl_gl_platform_info;
49
/* cl_gl_object_type */
50
#define CL_GL_OBJECT_BUFFER 0x2000
51
#define CL_GL_OBJECT_TEXTURE2D 0x2001
52
#define CL_GL_OBJECT_TEXTURE3D 0x2002
53
#define CL_GL_OBJECT_RENDERBUFFER 0x2003
55
/* cl_gl_texture_info */
56
#define CL_GL_TEXTURE_TARGET 0x2004
57
#define CL_GL_MIPMAP_LEVEL 0x2005
59
extern CL_API_ENTRY cl_mem CL_API_CALL
60
clCreateFromGLBuffer(cl_context /* context */,
61
cl_mem_flags /* flags */,
62
cl_GLuint /* bufobj */,
63
int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
65
extern CL_API_ENTRY cl_mem CL_API_CALL
66
clCreateFromGLTexture2D(cl_context /* context */,
67
cl_mem_flags /* flags */,
68
cl_GLenum /* target */,
69
cl_GLint /* miplevel */,
70
cl_GLuint /* texture */,
71
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
73
extern CL_API_ENTRY cl_mem CL_API_CALL
74
clCreateFromGLTexture3D(cl_context /* context */,
75
cl_mem_flags /* flags */,
76
cl_GLenum /* target */,
77
cl_GLint /* miplevel */,
78
cl_GLuint /* texture */,
79
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
81
extern CL_API_ENTRY cl_mem CL_API_CALL
82
clCreateFromGLRenderbuffer(cl_context /* context */,
83
cl_mem_flags /* flags */,
84
cl_GLuint /* renderbuffer */,
85
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
87
extern CL_API_ENTRY cl_int CL_API_CALL
88
clGetGLObjectInfo(cl_mem /* memobj */,
89
cl_gl_object_type * /* gl_object_type */,
90
cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
92
extern CL_API_ENTRY cl_int CL_API_CALL
93
clGetGLTextureInfo(cl_mem /* memobj */,
94
cl_gl_texture_info /* param_name */,
95
size_t /* param_value_size */,
96
void * /* param_value */,
97
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
99
extern CL_API_ENTRY cl_int CL_API_CALL
100
clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */,
101
cl_uint /* num_objects */,
102
const cl_mem * /* mem_objects */,
103
cl_uint /* num_events_in_wait_list */,
104
const cl_event * /* event_wait_list */,
105
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
107
extern CL_API_ENTRY cl_int CL_API_CALL
108
clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */,
109
cl_uint /* num_objects */,
110
const cl_mem * /* mem_objects */,
111
cl_uint /* num_events_in_wait_list */,
112
const cl_event * /* event_wait_list */,
113
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
115
/* cl_khr_gl_sharing extension */
117
#define cl_khr_gl_sharing 1
119
typedef cl_uint cl_gl_context_info;
121
/* Additional Error Codes */
122
#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
124
/* cl_gl_context_info */
125
#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
126
#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
128
/* Additional cl_context_properties */
129
#define CL_GL_CONTEXT_KHR 0x2008
130
#define CL_EGL_DISPLAY_KHR 0x2009
131
#define CL_GLX_DISPLAY_KHR 0x200A
132
#define CL_WGL_HDC_KHR 0x200B
133
#define CL_CGL_SHAREGROUP_KHR 0x200C
135
extern CL_API_ENTRY cl_int CL_API_CALL
136
clGetGLContextInfoKHR(const cl_context_properties * /* properties */,
137
cl_gl_context_info /* param_name */,
138
size_t /* param_value_size */,
139
void * /* param_value */,
140
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
146
#endif /* __OPENCL_CL_GL_H */