Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /******************************************************************************* |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 2 | * Copyright (c) 2008-2020 The Khronos Group Inc. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 3 | * |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 4 | * 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 Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 7 | * |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 9 | * |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 10 | * 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 Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 15 | ******************************************************************************/ |
| 16 | |
| 17 | #ifndef __OPENCL_CL_EGL_H |
| 18 | #define __OPENCL_CL_EGL_H |
| 19 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 20 | #include <CL/cl.h> |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 21 | |
| 22 | #ifdef __cplusplus |
| 23 | extern "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 */ |
| 37 | typedef void* CLeglImageKHR; |
| 38 | |
| 39 | /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ |
| 40 | typedef void* CLeglDisplayKHR; |
| 41 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 42 | /* CLeglSyncKHR is an opaque handle to an EGLSync object */ |
| 43 | typedef void* CLeglSyncKHR; |
| 44 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 45 | /* properties passed to clCreateFromEGLImageKHR */ |
| 46 | typedef intptr_t cl_egl_image_properties_khr; |
| 47 | |
| 48 | |
| 49 | #define cl_khr_egl_image 1 |
| 50 | |
| 51 | extern CL_API_ENTRY cl_mem CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame] | 52 | clCreateFromEGLImageKHR(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 Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 58 | |
Pablo Marquez Tello | dc2282f | 2021-11-23 15:16:00 +0000 | [diff] [blame] | 59 | typedef cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)( |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame] | 60 | 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 Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 66 | |
| 67 | |
| 68 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame] | 69 | clEnqueueAcquireEGLObjectsKHR(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 Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 75 | |
Pablo Marquez Tello | dc2282f | 2021-11-23 15:16:00 +0000 | [diff] [blame] | 76 | typedef cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)( |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame] | 77 | 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 Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 83 | |
| 84 | |
| 85 | extern CL_API_ENTRY cl_int CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame] | 86 | clEnqueueReleaseEGLObjectsKHR(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 Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 92 | |
Pablo Marquez Tello | dc2282f | 2021-11-23 15:16:00 +0000 | [diff] [blame] | 93 | typedef cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)( |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame] | 94 | 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 Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 100 | |
| 101 | |
| 102 | #define cl_khr_egl_event 1 |
| 103 | |
| 104 | extern CL_API_ENTRY cl_event CL_API_CALL |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame] | 105 | clCreateEventFromEGLSyncKHR(cl_context context, |
| 106 | CLeglSyncKHR sync, |
| 107 | CLeglDisplayKHR display, |
| 108 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 109 | |
Pablo Marquez Tello | dc2282f | 2021-11-23 15:16:00 +0000 | [diff] [blame] | 110 | typedef cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)( |
Sheri Zhang | 67354e0 | 2021-06-30 16:08:29 +0100 | [diff] [blame] | 111 | cl_context context, |
| 112 | CLeglSyncKHR sync, |
| 113 | CLeglDisplayKHR display, |
| 114 | cl_int * errcode_ret); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 115 | |
| 116 | #ifdef __cplusplus |
| 117 | } |
| 118 | #endif |
| 119 | |
| 120 | #endif /* __OPENCL_CL_EGL_H */ |