blob: 357a37c021cf47efcdf23eea2fde880c790b89aa [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001/*******************************************************************************
Sheri Zhang79cb9452021-09-07 14:51:49 +01002 * Copyright (c) 2008-2020 The Khronos Group Inc.
Anthony Barbier6ff3b192017-09-04 18:44:23 +01003 *
Sheri Zhang79cb9452021-09-07 14:51:49 +01004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Anthony Barbier6ff3b192017-09-04 18:44:23 +01007 *
Sheri Zhang79cb9452021-09-07 14:51:49 +01008 * http://www.apache.org/licenses/LICENSE-2.0
Anthony Barbier6ff3b192017-09-04 18:44:23 +01009 *
Sheri Zhang79cb9452021-09-07 14:51:49 +010010 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Anthony Barbier6ff3b192017-09-04 18:44:23 +010015 ******************************************************************************/
16
17#ifndef __OPENCL_CL_EGL_H
18#define __OPENCL_CL_EGL_H
19
Anthony Barbier6ff3b192017-09-04 18:44:23 +010020#include <CL/cl.h>
Anthony Barbier6ff3b192017-09-04 18:44:23 +010021
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26
27/* Command type for events created with clEnqueueAcquireEGLObjectsKHR */
28#define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F
29#define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D
30#define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E
31
32/* Error type for clCreateFromEGLImageKHR */
33#define CL_INVALID_EGL_OBJECT_KHR -1093
34#define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092
35
36/* CLeglImageKHR is an opaque handle to an EGLImage */
37typedef void* CLeglImageKHR;
38
39/* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
40typedef void* CLeglDisplayKHR;
41
Pablo Telloe86a09f2018-01-11 15:44:48 +000042/* CLeglSyncKHR is an opaque handle to an EGLSync object */
43typedef void* CLeglSyncKHR;
44
Anthony Barbier6ff3b192017-09-04 18:44:23 +010045/* properties passed to clCreateFromEGLImageKHR */
46typedef intptr_t cl_egl_image_properties_khr;
47
48
49#define cl_khr_egl_image 1
50
51extern CL_API_ENTRY cl_mem CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +010052clCreateFromEGLImageKHR(cl_context context,
53 CLeglDisplayKHR egldisplay,
54 CLeglImageKHR eglimage,
55 cl_mem_flags flags,
56 const cl_egl_image_properties_khr * properties,
57 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010058
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +000059typedef cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +010060 cl_context context,
61 CLeglDisplayKHR egldisplay,
62 CLeglImageKHR eglimage,
63 cl_mem_flags flags,
64 const cl_egl_image_properties_khr * properties,
65 cl_int * errcode_ret);
Anthony Barbier6ff3b192017-09-04 18:44:23 +010066
67
68extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +010069clEnqueueAcquireEGLObjectsKHR(cl_command_queue command_queue,
70 cl_uint num_objects,
71 const cl_mem * mem_objects,
72 cl_uint num_events_in_wait_list,
73 const cl_event * event_wait_list,
74 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010075
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +000076typedef cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +010077 cl_command_queue command_queue,
78 cl_uint num_objects,
79 const cl_mem * mem_objects,
80 cl_uint num_events_in_wait_list,
81 const cl_event * event_wait_list,
82 cl_event * event);
Anthony Barbier6ff3b192017-09-04 18:44:23 +010083
84
85extern CL_API_ENTRY cl_int CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +010086clEnqueueReleaseEGLObjectsKHR(cl_command_queue command_queue,
87 cl_uint num_objects,
88 const cl_mem * mem_objects,
89 cl_uint num_events_in_wait_list,
90 const cl_event * event_wait_list,
91 cl_event * event) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010092
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +000093typedef cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +010094 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);
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100100
101
102#define cl_khr_egl_event 1
103
104extern CL_API_ENTRY cl_event CL_API_CALL
Sheri Zhang67354e02021-06-30 16:08:29 +0100105clCreateEventFromEGLSyncKHR(cl_context context,
106 CLeglSyncKHR sync,
107 CLeglDisplayKHR display,
108 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100109
Pablo Marquez Tellodc2282f2021-11-23 15:16:00 +0000110typedef cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)(
Sheri Zhang67354e02021-06-30 16:08:29 +0100111 cl_context context,
112 CLeglSyncKHR sync,
113 CLeglDisplayKHR display,
114 cl_int * errcode_ret);
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100115
116#ifdef __cplusplus
117}
118#endif
119
120#endif /* __OPENCL_CL_EGL_H */