0
|
1 /**********************************************************************************
|
|
2 * Copyright (c) 2008-2009 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
|
1
|
24 // $Revision: 10424 $ on $Date: 2010-02-17 14:34:49 -0800 (Wed, 17 Feb 2010) $
|
0
|
25
|
1
|
26 /**
|
|
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.
|
|
30 */
|
0
|
31 module opencl.c.cl_gl;
|
|
32
|
1
|
33 //import opencl.c.platform;
|
|
34 import opencl.c.cl;
|
0
|
35
|
|
36 extern(C):
|
|
37
|
1
|
38 typedef cl_uint cl_gl_object_type;
|
|
39 typedef cl_uint cl_gl_texture_info;
|
|
40 typedef cl_uint cl_gl_platform_info;
|
0
|
41
|
|
42 enum
|
|
43 {
|
|
44 // cl_gl_object_type
|
1
|
45 CL_GL_OBJECT_BUFFER = 0x2000,
|
|
46 CL_GL_OBJECT_TEXTURE2D = 0x2001,
|
|
47 CL_GL_OBJECT_TEXTURE3D = 0x2002,
|
|
48 CL_GL_OBJECT_RENDERBUFFER = 0x2003,
|
0
|
49
|
|
50 // cl_gl_texture_info
|
1
|
51 CL_GL_TEXTURE_TARGET = 0x2004,
|
|
52 CL_GL_MIPMAP_LEVEL = 0x2005,
|
0
|
53 }
|
|
54
|
|
55 cl_mem clCreateFromGLBuffer(
|
1
|
56 cl_context context,
|
|
57 cl_mem_flags flags,
|
|
58 cl_GLuint bufobj,
|
|
59 int* errcode_ret
|
0
|
60 );
|
|
61
|
|
62 cl_mem clCreateFromGLTexture2D(
|
1
|
63 cl_context context,
|
|
64 cl_mem_flags flags,
|
|
65 cl_GLenum target,
|
|
66 cl_GLint miplevel,
|
|
67 cl_GLuint texture,
|
|
68 cl_int* errcode_ret
|
0
|
69 );
|
|
70
|
|
71 cl_mem clCreateFromGLTexture3D(
|
1
|
72 cl_context context,
|
|
73 cl_mem_flags flags,
|
|
74 cl_GLenum target,
|
|
75 cl_GLint miplevel,
|
|
76 cl_GLuint texture,
|
|
77 cl_int* errcode_ret
|
0
|
78 );
|
|
79
|
|
80 cl_mem clCreateFromGLRenderbuffer(
|
1
|
81 cl_context context,
|
|
82 cl_mem_flags flags,
|
|
83 cl_GLuint renderbuffer,
|
|
84 cl_int* errcode_ret
|
0
|
85 );
|
|
86
|
|
87 cl_int clGetGLObjectInfo(
|
1
|
88 cl_mem memobj,
|
|
89 cl_gl_object_type* gl_object_type,
|
|
90 cl_GLuint* gl_object_name
|
0
|
91 );
|
1
|
92
|
0
|
93 cl_int clGetGLTextureInfo(
|
1
|
94 cl_mem memobj,
|
|
95 cl_gl_texture_info param_name,
|
|
96 size_t param_value_size,
|
|
97 void* param_value,
|
|
98 size_t* param_value_size_ret
|
0
|
99 );
|
|
100
|
|
101 cl_int clEnqueueAcquireGLObjects(
|
1
|
102 cl_command_queue 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
|
0
|
108 );
|
|
109
|
|
110 cl_int clEnqueueReleaseGLObjects(
|
1
|
111 cl_command_queue queue,
|
|
112 cl_uint num_objects,
|
|
113 const(cl_mem)* mem_objects,
|
|
114 cl_uint num_events_in_wait_list,
|
|
115 const(cl_event)* event_wait_list,
|
|
116 cl_event* event
|
|
117 );
|
|
118
|
|
119
|
|
120 // cl_khr_gl_sharing extension
|
|
121
|
|
122 const cl_khr_gl_sharing = 1;
|
|
123
|
|
124 typedef cl_uint cl_gl_context_info;
|
|
125
|
|
126 enum
|
|
127 {
|
|
128 // Additional Error Codes
|
|
129 CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR = -1000,
|
|
130
|
|
131 // cl_gl_context_info
|
|
132 CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR = 0x2006,
|
|
133 CL_DEVICES_FOR_GL_CONTEXT_KHR = 0x2007,
|
|
134
|
|
135 // Additional cl_context_properties
|
|
136 CL_GL_CONTEXT_KHR = 0x2008,
|
|
137 CL_EGL_DISPLAY_KHR = 0x2009,
|
|
138 CL_GLX_DISPLAY_KHR = 0x200A,
|
|
139 CL_WGL_HDC_KHR = 0x200B,
|
|
140 CL_CGL_SHAREGROUP_KHR = 0x200C,
|
|
141 }
|
|
142
|
|
143 cl_int clGetGLContextInfoKHR(
|
|
144 const(cl_context_properties)* properties,
|
|
145 cl_gl_context_info param_name,
|
|
146 size_t param_value_size,
|
|
147 void* param_value,
|
|
148 size_t* param_value_size_ret
|
0
|
149 ); |