1 /******************************************************************************* 2 * Copyright (c) 2008-2023 The Khronos Group Inc. 3 * 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 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 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. 15 ******************************************************************************/ 16 17 #ifndef OPENCL_CL_EGL_H_ 18 #define OPENCL_CL_EGL_H_ 19 20 /* 21 ** This header is generated from the Khronos OpenCL XML API Registry. 22 */ 23 24 #include <CL/cl.h> 25 26 /* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */ 27 #if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES) 28 #define CL_NO_EXTENSION_PROTOTYPES 29 #endif 30 31 /* CL_NO_EXTENSION_PROTOTYPES implies 32 CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and 33 CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */ 34 #if defined(CL_NO_EXTENSION_PROTOTYPES) && \ 35 !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) 36 #define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES 37 #endif 38 #if defined(CL_NO_EXTENSION_PROTOTYPES) && \ 39 !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) 40 #define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES 41 #endif 42 43 #ifdef __cplusplus 44 extern "C" { 45 #endif 46 47 /*************************************************************** 48 * cl_khr_egl_image 49 ***************************************************************/ 50 #define cl_khr_egl_image 1 51 #define CL_KHR_EGL_IMAGE_EXTENSION_NAME \ 52 "cl_khr_egl_image" 53 54 55 #define CL_KHR_EGL_IMAGE_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0) 56 57 /* Command type for events created with clEnqueueAcquireEGLObjectsKHR */ 58 #define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F 59 #define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D 60 #define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E 61 62 /* Error type for clCreateFromEGLImageKHR */ 63 #define CL_INVALID_EGL_OBJECT_KHR -1093 64 #define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092 65 66 /* CLeglImageKHR is an opaque handle to an EGLImage */ 67 typedef void* CLeglImageKHR; 68 69 /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ 70 typedef void* CLeglDisplayKHR; 71 72 /* properties passed to clCreateFromEGLImageKHR */ 73 typedef intptr_t cl_egl_image_properties_khr; 74 75 76 typedef cl_mem CL_API_CALL 77 clCreateFromEGLImageKHR_t( 78 cl_context context, 79 CLeglDisplayKHR egldisplay, 80 CLeglImageKHR eglimage, 81 cl_mem_flags flags, 82 const cl_egl_image_properties_khr* properties, 83 cl_int* errcode_ret); 84 85 typedef clCreateFromEGLImageKHR_t * 86 clCreateFromEGLImageKHR_fn CL_API_SUFFIX__VERSION_1_0; 87 88 typedef cl_int CL_API_CALL 89 clEnqueueAcquireEGLObjectsKHR_t( 90 cl_command_queue command_queue, 91 cl_uint num_objects, 92 const cl_mem* mem_objects, 93 cl_uint num_events_in_wait_list, 94 const cl_event* event_wait_list, 95 cl_event* event); 96 97 typedef clEnqueueAcquireEGLObjectsKHR_t * 98 clEnqueueAcquireEGLObjectsKHR_fn CL_API_SUFFIX__VERSION_1_0; 99 100 typedef cl_int CL_API_CALL 101 clEnqueueReleaseEGLObjectsKHR_t( 102 cl_command_queue command_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); 108 109 typedef clEnqueueReleaseEGLObjectsKHR_t * 110 clEnqueueReleaseEGLObjectsKHR_fn CL_API_SUFFIX__VERSION_1_0; 111 112 #if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) 113 114 extern CL_API_ENTRY cl_mem CL_API_CALL 115 clCreateFromEGLImageKHR( 116 cl_context context, 117 CLeglDisplayKHR egldisplay, 118 CLeglImageKHR eglimage, 119 cl_mem_flags flags, 120 const cl_egl_image_properties_khr* properties, 121 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; 122 123 extern CL_API_ENTRY cl_int CL_API_CALL 124 clEnqueueAcquireEGLObjectsKHR( 125 cl_command_queue command_queue, 126 cl_uint num_objects, 127 const cl_mem* mem_objects, 128 cl_uint num_events_in_wait_list, 129 const cl_event* event_wait_list, 130 cl_event* event) CL_API_SUFFIX__VERSION_1_0; 131 132 extern CL_API_ENTRY cl_int CL_API_CALL 133 clEnqueueReleaseEGLObjectsKHR( 134 cl_command_queue command_queue, 135 cl_uint num_objects, 136 const cl_mem* mem_objects, 137 cl_uint num_events_in_wait_list, 138 const cl_event* event_wait_list, 139 cl_event* event) CL_API_SUFFIX__VERSION_1_0; 140 141 #endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ 142 143 /*************************************************************** 144 * cl_khr_egl_event 145 ***************************************************************/ 146 #define cl_khr_egl_event 1 147 #define CL_KHR_EGL_EVENT_EXTENSION_NAME \ 148 "cl_khr_egl_event" 149 150 151 #define CL_KHR_EGL_EVENT_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0) 152 153 /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ 154 /* type CLeglDisplayKHR */ 155 156 /* CLeglSyncKHR is an opaque handle to an EGLSync object */ 157 typedef void* CLeglSyncKHR; 158 159 160 typedef cl_event CL_API_CALL 161 clCreateEventFromEGLSyncKHR_t( 162 cl_context context, 163 CLeglSyncKHR sync, 164 CLeglDisplayKHR display, 165 cl_int* errcode_ret); 166 167 typedef clCreateEventFromEGLSyncKHR_t * 168 clCreateEventFromEGLSyncKHR_fn CL_API_SUFFIX__VERSION_1_0; 169 170 #if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) 171 172 extern CL_API_ENTRY cl_event CL_API_CALL 173 clCreateEventFromEGLSyncKHR( 174 cl_context context, 175 CLeglSyncKHR sync, 176 CLeglDisplayKHR display, 177 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; 178 179 #endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ 180 181 #ifdef __cplusplus 182 } 183 #endif 184 185 #endif /* OPENCL_CL_EGL_H_ */ 186