xref: /aosp_15_r20/external/angle/include/CL/cl_egl.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker /*******************************************************************************
2*8975f5c5SAndroid Build Coastguard Worker  * Copyright (c) 2008-2023 The Khronos Group Inc.
3*8975f5c5SAndroid Build Coastguard Worker  *
4*8975f5c5SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*8975f5c5SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*8975f5c5SAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*8975f5c5SAndroid Build Coastguard Worker  *
8*8975f5c5SAndroid Build Coastguard Worker  *    http://www.apache.org/licenses/LICENSE-2.0
9*8975f5c5SAndroid Build Coastguard Worker  *
10*8975f5c5SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*8975f5c5SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*8975f5c5SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*8975f5c5SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*8975f5c5SAndroid Build Coastguard Worker  * limitations under the License.
15*8975f5c5SAndroid Build Coastguard Worker  ******************************************************************************/
16*8975f5c5SAndroid Build Coastguard Worker 
17*8975f5c5SAndroid Build Coastguard Worker #ifndef OPENCL_CL_EGL_H_
18*8975f5c5SAndroid Build Coastguard Worker #define OPENCL_CL_EGL_H_
19*8975f5c5SAndroid Build Coastguard Worker 
20*8975f5c5SAndroid Build Coastguard Worker /*
21*8975f5c5SAndroid Build Coastguard Worker ** This header is generated from the Khronos OpenCL XML API Registry.
22*8975f5c5SAndroid Build Coastguard Worker */
23*8975f5c5SAndroid Build Coastguard Worker 
24*8975f5c5SAndroid Build Coastguard Worker #include <CL/cl.h>
25*8975f5c5SAndroid Build Coastguard Worker 
26*8975f5c5SAndroid Build Coastguard Worker /* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */
27*8975f5c5SAndroid Build Coastguard Worker #if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES)
28*8975f5c5SAndroid Build Coastguard Worker #define CL_NO_EXTENSION_PROTOTYPES
29*8975f5c5SAndroid Build Coastguard Worker #endif
30*8975f5c5SAndroid Build Coastguard Worker 
31*8975f5c5SAndroid Build Coastguard Worker /* CL_NO_EXTENSION_PROTOTYPES implies
32*8975f5c5SAndroid Build Coastguard Worker    CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and
33*8975f5c5SAndroid Build Coastguard Worker    CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */
34*8975f5c5SAndroid Build Coastguard Worker #if defined(CL_NO_EXTENSION_PROTOTYPES) && \
35*8975f5c5SAndroid Build Coastguard Worker     !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
36*8975f5c5SAndroid Build Coastguard Worker #define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES
37*8975f5c5SAndroid Build Coastguard Worker #endif
38*8975f5c5SAndroid Build Coastguard Worker #if defined(CL_NO_EXTENSION_PROTOTYPES) && \
39*8975f5c5SAndroid Build Coastguard Worker     !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
40*8975f5c5SAndroid Build Coastguard Worker #define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES
41*8975f5c5SAndroid Build Coastguard Worker #endif
42*8975f5c5SAndroid Build Coastguard Worker 
43*8975f5c5SAndroid Build Coastguard Worker #ifdef __cplusplus
44*8975f5c5SAndroid Build Coastguard Worker extern "C" {
45*8975f5c5SAndroid Build Coastguard Worker #endif
46*8975f5c5SAndroid Build Coastguard Worker 
47*8975f5c5SAndroid Build Coastguard Worker /***************************************************************
48*8975f5c5SAndroid Build Coastguard Worker * cl_khr_egl_image
49*8975f5c5SAndroid Build Coastguard Worker ***************************************************************/
50*8975f5c5SAndroid Build Coastguard Worker #define cl_khr_egl_image 1
51*8975f5c5SAndroid Build Coastguard Worker #define CL_KHR_EGL_IMAGE_EXTENSION_NAME \
52*8975f5c5SAndroid Build Coastguard Worker     "cl_khr_egl_image"
53*8975f5c5SAndroid Build Coastguard Worker 
54*8975f5c5SAndroid Build Coastguard Worker /* Command type for events created with clEnqueueAcquireEGLObjectsKHR */
55*8975f5c5SAndroid Build Coastguard Worker #define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR                0x202F
56*8975f5c5SAndroid Build Coastguard Worker #define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR                  0x202D
57*8975f5c5SAndroid Build Coastguard Worker #define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR                  0x202E
58*8975f5c5SAndroid Build Coastguard Worker 
59*8975f5c5SAndroid Build Coastguard Worker /* Error type for clCreateFromEGLImageKHR */
60*8975f5c5SAndroid Build Coastguard Worker #define CL_INVALID_EGL_OBJECT_KHR                           -1093
61*8975f5c5SAndroid Build Coastguard Worker #define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR                    -1092
62*8975f5c5SAndroid Build Coastguard Worker 
63*8975f5c5SAndroid Build Coastguard Worker /* CLeglImageKHR is an opaque handle to an EGLImage */
64*8975f5c5SAndroid Build Coastguard Worker typedef void*               CLeglImageKHR;
65*8975f5c5SAndroid Build Coastguard Worker 
66*8975f5c5SAndroid Build Coastguard Worker /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
67*8975f5c5SAndroid Build Coastguard Worker typedef void*               CLeglDisplayKHR;
68*8975f5c5SAndroid Build Coastguard Worker 
69*8975f5c5SAndroid Build Coastguard Worker /* properties passed to clCreateFromEGLImageKHR */
70*8975f5c5SAndroid Build Coastguard Worker typedef intptr_t            cl_egl_image_properties_khr;
71*8975f5c5SAndroid Build Coastguard Worker 
72*8975f5c5SAndroid Build Coastguard Worker 
73*8975f5c5SAndroid Build Coastguard Worker typedef cl_mem CL_API_CALL
74*8975f5c5SAndroid Build Coastguard Worker clCreateFromEGLImageKHR_t(
75*8975f5c5SAndroid Build Coastguard Worker     cl_context context,
76*8975f5c5SAndroid Build Coastguard Worker     CLeglDisplayKHR egldisplay,
77*8975f5c5SAndroid Build Coastguard Worker     CLeglImageKHR eglimage,
78*8975f5c5SAndroid Build Coastguard Worker     cl_mem_flags flags,
79*8975f5c5SAndroid Build Coastguard Worker     const cl_egl_image_properties_khr* properties,
80*8975f5c5SAndroid Build Coastguard Worker     cl_int* errcode_ret);
81*8975f5c5SAndroid Build Coastguard Worker 
82*8975f5c5SAndroid Build Coastguard Worker typedef clCreateFromEGLImageKHR_t *
83*8975f5c5SAndroid Build Coastguard Worker clCreateFromEGLImageKHR_fn CL_API_SUFFIX__VERSION_1_0;
84*8975f5c5SAndroid Build Coastguard Worker 
85*8975f5c5SAndroid Build Coastguard Worker typedef cl_int CL_API_CALL
86*8975f5c5SAndroid Build Coastguard Worker clEnqueueAcquireEGLObjectsKHR_t(
87*8975f5c5SAndroid Build Coastguard Worker     cl_command_queue command_queue,
88*8975f5c5SAndroid Build Coastguard Worker     cl_uint num_objects,
89*8975f5c5SAndroid Build Coastguard Worker     const cl_mem* mem_objects,
90*8975f5c5SAndroid Build Coastguard Worker     cl_uint num_events_in_wait_list,
91*8975f5c5SAndroid Build Coastguard Worker     const cl_event* event_wait_list,
92*8975f5c5SAndroid Build Coastguard Worker     cl_event* event);
93*8975f5c5SAndroid Build Coastguard Worker 
94*8975f5c5SAndroid Build Coastguard Worker typedef clEnqueueAcquireEGLObjectsKHR_t *
95*8975f5c5SAndroid Build Coastguard Worker clEnqueueAcquireEGLObjectsKHR_fn CL_API_SUFFIX__VERSION_1_0;
96*8975f5c5SAndroid Build Coastguard Worker 
97*8975f5c5SAndroid Build Coastguard Worker typedef cl_int CL_API_CALL
98*8975f5c5SAndroid Build Coastguard Worker clEnqueueReleaseEGLObjectsKHR_t(
99*8975f5c5SAndroid Build Coastguard Worker     cl_command_queue command_queue,
100*8975f5c5SAndroid Build Coastguard Worker     cl_uint num_objects,
101*8975f5c5SAndroid Build Coastguard Worker     const cl_mem* mem_objects,
102*8975f5c5SAndroid Build Coastguard Worker     cl_uint num_events_in_wait_list,
103*8975f5c5SAndroid Build Coastguard Worker     const cl_event* event_wait_list,
104*8975f5c5SAndroid Build Coastguard Worker     cl_event* event);
105*8975f5c5SAndroid Build Coastguard Worker 
106*8975f5c5SAndroid Build Coastguard Worker typedef clEnqueueReleaseEGLObjectsKHR_t *
107*8975f5c5SAndroid Build Coastguard Worker clEnqueueReleaseEGLObjectsKHR_fn CL_API_SUFFIX__VERSION_1_0;
108*8975f5c5SAndroid Build Coastguard Worker 
109*8975f5c5SAndroid Build Coastguard Worker #if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
110*8975f5c5SAndroid Build Coastguard Worker 
111*8975f5c5SAndroid Build Coastguard Worker extern CL_API_ENTRY cl_mem CL_API_CALL
112*8975f5c5SAndroid Build Coastguard Worker clCreateFromEGLImageKHR(
113*8975f5c5SAndroid Build Coastguard Worker     cl_context context,
114*8975f5c5SAndroid Build Coastguard Worker     CLeglDisplayKHR egldisplay,
115*8975f5c5SAndroid Build Coastguard Worker     CLeglImageKHR eglimage,
116*8975f5c5SAndroid Build Coastguard Worker     cl_mem_flags flags,
117*8975f5c5SAndroid Build Coastguard Worker     const cl_egl_image_properties_khr* properties,
118*8975f5c5SAndroid Build Coastguard Worker     cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
119*8975f5c5SAndroid Build Coastguard Worker 
120*8975f5c5SAndroid Build Coastguard Worker extern CL_API_ENTRY cl_int CL_API_CALL
121*8975f5c5SAndroid Build Coastguard Worker clEnqueueAcquireEGLObjectsKHR(
122*8975f5c5SAndroid Build Coastguard Worker     cl_command_queue command_queue,
123*8975f5c5SAndroid Build Coastguard Worker     cl_uint num_objects,
124*8975f5c5SAndroid Build Coastguard Worker     const cl_mem* mem_objects,
125*8975f5c5SAndroid Build Coastguard Worker     cl_uint num_events_in_wait_list,
126*8975f5c5SAndroid Build Coastguard Worker     const cl_event* event_wait_list,
127*8975f5c5SAndroid Build Coastguard Worker     cl_event* event) CL_API_SUFFIX__VERSION_1_0;
128*8975f5c5SAndroid Build Coastguard Worker 
129*8975f5c5SAndroid Build Coastguard Worker extern CL_API_ENTRY cl_int CL_API_CALL
130*8975f5c5SAndroid Build Coastguard Worker clEnqueueReleaseEGLObjectsKHR(
131*8975f5c5SAndroid Build Coastguard Worker     cl_command_queue command_queue,
132*8975f5c5SAndroid Build Coastguard Worker     cl_uint num_objects,
133*8975f5c5SAndroid Build Coastguard Worker     const cl_mem* mem_objects,
134*8975f5c5SAndroid Build Coastguard Worker     cl_uint num_events_in_wait_list,
135*8975f5c5SAndroid Build Coastguard Worker     const cl_event* event_wait_list,
136*8975f5c5SAndroid Build Coastguard Worker     cl_event* event) CL_API_SUFFIX__VERSION_1_0;
137*8975f5c5SAndroid Build Coastguard Worker 
138*8975f5c5SAndroid Build Coastguard Worker #endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
139*8975f5c5SAndroid Build Coastguard Worker 
140*8975f5c5SAndroid Build Coastguard Worker /***************************************************************
141*8975f5c5SAndroid Build Coastguard Worker * cl_khr_egl_event
142*8975f5c5SAndroid Build Coastguard Worker ***************************************************************/
143*8975f5c5SAndroid Build Coastguard Worker #define cl_khr_egl_event 1
144*8975f5c5SAndroid Build Coastguard Worker #define CL_KHR_EGL_EVENT_EXTENSION_NAME \
145*8975f5c5SAndroid Build Coastguard Worker     "cl_khr_egl_event"
146*8975f5c5SAndroid Build Coastguard Worker 
147*8975f5c5SAndroid Build Coastguard Worker /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
148*8975f5c5SAndroid Build Coastguard Worker /* type CLeglDisplayKHR */
149*8975f5c5SAndroid Build Coastguard Worker 
150*8975f5c5SAndroid Build Coastguard Worker /* CLeglSyncKHR is an opaque handle to an EGLSync object */
151*8975f5c5SAndroid Build Coastguard Worker typedef void*               CLeglSyncKHR;
152*8975f5c5SAndroid Build Coastguard Worker 
153*8975f5c5SAndroid Build Coastguard Worker 
154*8975f5c5SAndroid Build Coastguard Worker typedef cl_event CL_API_CALL
155*8975f5c5SAndroid Build Coastguard Worker clCreateEventFromEGLSyncKHR_t(
156*8975f5c5SAndroid Build Coastguard Worker     cl_context context,
157*8975f5c5SAndroid Build Coastguard Worker     CLeglSyncKHR sync,
158*8975f5c5SAndroid Build Coastguard Worker     CLeglDisplayKHR display,
159*8975f5c5SAndroid Build Coastguard Worker     cl_int* errcode_ret);
160*8975f5c5SAndroid Build Coastguard Worker 
161*8975f5c5SAndroid Build Coastguard Worker typedef clCreateEventFromEGLSyncKHR_t *
162*8975f5c5SAndroid Build Coastguard Worker clCreateEventFromEGLSyncKHR_fn CL_API_SUFFIX__VERSION_1_0;
163*8975f5c5SAndroid Build Coastguard Worker 
164*8975f5c5SAndroid Build Coastguard Worker #if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
165*8975f5c5SAndroid Build Coastguard Worker 
166*8975f5c5SAndroid Build Coastguard Worker extern CL_API_ENTRY cl_event CL_API_CALL
167*8975f5c5SAndroid Build Coastguard Worker clCreateEventFromEGLSyncKHR(
168*8975f5c5SAndroid Build Coastguard Worker     cl_context context,
169*8975f5c5SAndroid Build Coastguard Worker     CLeglSyncKHR sync,
170*8975f5c5SAndroid Build Coastguard Worker     CLeglDisplayKHR display,
171*8975f5c5SAndroid Build Coastguard Worker     cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
172*8975f5c5SAndroid Build Coastguard Worker 
173*8975f5c5SAndroid Build Coastguard Worker #endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
174*8975f5c5SAndroid Build Coastguard Worker 
175*8975f5c5SAndroid Build Coastguard Worker #ifdef __cplusplus
176*8975f5c5SAndroid Build Coastguard Worker }
177*8975f5c5SAndroid Build Coastguard Worker #endif
178*8975f5c5SAndroid Build Coastguard Worker 
179*8975f5c5SAndroid Build Coastguard Worker #endif /* OPENCL_CL_EGL_H_ */
180