Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/include/CL/cl_gl.h
4545 views
1
/**********************************************************************************
2
* Copyright (c) 2008-2019 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
* MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16
* KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17
* SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18
* https://www.khronos.org/registry/
19
*
20
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27
**********************************************************************************/
28
29
#ifndef __OPENCL_CL_GL_H
30
#define __OPENCL_CL_GL_H
31
32
#include <CL/cl.h>
33
34
#ifdef __cplusplus
35
extern "C" {
36
#endif
37
38
typedef cl_uint cl_gl_object_type;
39
typedef cl_uint cl_gl_texture_info;
40
typedef cl_uint cl_gl_platform_info;
41
typedef struct __GLsync *cl_GLsync;
42
43
/* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */
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
48
#ifdef CL_VERSION_1_2
49
#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E
50
#define CL_GL_OBJECT_TEXTURE1D 0x200F
51
#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010
52
#define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011
53
#endif
54
55
/* cl_gl_texture_info */
56
#define CL_GL_TEXTURE_TARGET 0x2004
57
#define CL_GL_MIPMAP_LEVEL 0x2005
58
#ifdef CL_VERSION_1_2
59
#define CL_GL_NUM_SAMPLES 0x2012
60
#endif
61
62
63
extern CL_API_ENTRY cl_mem CL_API_CALL
64
clCreateFromGLBuffer(cl_context context,
65
cl_mem_flags flags,
66
cl_GLuint bufobj,
67
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
68
69
#ifdef CL_VERSION_1_2
70
71
extern CL_API_ENTRY cl_mem CL_API_CALL
72
clCreateFromGLTexture(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) CL_API_SUFFIX__VERSION_1_2;
78
79
#endif
80
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;
86
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;
91
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;
98
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;
106
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;
114
115
116
/* Deprecated OpenCL 1.1 APIs */
117
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
118
clCreateFromGLTexture2D(cl_context context,
119
cl_mem_flags flags,
120
cl_GLenum target,
121
cl_GLint miplevel,
122
cl_GLuint texture,
123
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
124
125
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
126
clCreateFromGLTexture3D(cl_context context,
127
cl_mem_flags flags,
128
cl_GLenum target,
129
cl_GLint miplevel,
130
cl_GLuint texture,
131
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
132
133
/* cl_khr_gl_sharing extension */
134
135
#define cl_khr_gl_sharing 1
136
137
typedef cl_uint cl_gl_context_info;
138
139
/* Additional Error Codes */
140
#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
141
142
/* cl_gl_context_info */
143
#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
144
#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
145
146
/* Additional cl_context_properties */
147
#define CL_GL_CONTEXT_KHR 0x2008
148
#define CL_EGL_DISPLAY_KHR 0x2009
149
#define CL_GLX_DISPLAY_KHR 0x200A
150
#define CL_WGL_HDC_KHR 0x200B
151
#define CL_CGL_SHAREGROUP_KHR 0x200C
152
153
extern CL_API_ENTRY cl_int CL_API_CALL
154
clGetGLContextInfoKHR(const cl_context_properties * properties,
155
cl_gl_context_info param_name,
156
size_t param_value_size,
157
void * param_value,
158
size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
159
160
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
161
const cl_context_properties * properties,
162
cl_gl_context_info param_name,
163
size_t param_value_size,
164
void * param_value,
165
size_t * param_value_size_ret);
166
167
#ifdef __cplusplus
168
}
169
#endif
170
171
#endif /* __OPENCL_CL_GL_H */
172
173