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 #ifndef __OPENCL_CL_GL_H
25 #define __OPENCL_CL_GL_H
28 #include <OpenCL/cl_platform.h>
30 #include <MiniCL/cl_platform.h>
37 // NOTE: Make sure that appropriate GL header file is included separately
39 typedef cl_uint cl_gl_object_type;
40 typedef cl_uint cl_gl_texture_info;
41 typedef cl_uint cl_gl_platform_info;
44 #define CL_GL_OBJECT_BUFFER 0x2000
45 #define CL_GL_OBJECT_TEXTURE2D 0x2001
46 #define CL_GL_OBJECT_TEXTURE3D 0x2002
47 #define CL_GL_OBJECT_RENDERBUFFER 0x2003
50 #define CL_GL_TEXTURE_TARGET 0x2004
51 #define CL_GL_MIPMAP_LEVEL 0x2005
53 extern CL_API_ENTRY cl_mem CL_API_CALL
54 clCreateFromGLBuffer(cl_context /* context */,
55 cl_mem_flags /* flags */,
57 int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
59 extern CL_API_ENTRY cl_mem CL_API_CALL
60 clCreateFromGLTexture2D(cl_context /* context */,
61 cl_mem_flags /* flags */,
65 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
67 extern CL_API_ENTRY cl_mem CL_API_CALL
68 clCreateFromGLTexture3D(cl_context /* context */,
69 cl_mem_flags /* flags */,
73 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
75 extern CL_API_ENTRY cl_mem CL_API_CALL
76 clCreateFromGLRenderbuffer(cl_context /* context */,
77 cl_mem_flags /* flags */,
78 GLuint /* renderbuffer */,
79 cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
81 extern CL_API_ENTRY cl_int CL_API_CALL
82 clGetGLObjectInfo(cl_mem /* memobj */,
83 cl_gl_object_type * /* gl_object_type */,
84 GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
86 extern CL_API_ENTRY cl_int CL_API_CALL
87 clGetGLTextureInfo(cl_mem /* memobj */,
88 cl_gl_texture_info /* param_name */,
89 size_t /* param_value_size */,
90 void * /* param_value */,
91 size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
93 extern CL_API_ENTRY cl_int CL_API_CALL
94 clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */,
95 cl_uint /* num_objects */,
96 const cl_mem * /* mem_objects */,
97 cl_uint /* num_events_in_wait_list */,
98 const cl_event * /* event_wait_list */,
99 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
101 extern CL_API_ENTRY cl_int CL_API_CALL
102 clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */,
103 cl_uint /* num_objects */,
104 const cl_mem * /* mem_objects */,
105 cl_uint /* num_events_in_wait_list */,
106 const cl_event * /* event_wait_list */,
107 cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
113 #endif // __OPENCL_CL_GL_H