1#![allow(non_camel_case_types)]
20
21use super::cl::{cl_command_queue, cl_command_type, cl_context, cl_event, cl_mem, cl_mem_flags};
22use super::cl_platform::{cl_int, cl_uint};
23use libc::{c_void, intptr_t};
24
25pub const CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR: cl_command_type = 0x202F;
27pub const CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR: cl_command_type = 0x202D;
28pub const CL_COMMAND_RELEASE_EGL_OBJECTS_KHR: cl_command_type = 0x202E;
29
30pub const CL_INVALID_EGL_OBJECT_KHR: cl_int = -1093;
32pub const CL_EGL_RESOURCE_NOT_ACQUIRED_KHR: cl_int = -1092;
33
34pub type CLeglImageKHR = *mut c_void;
36
37pub type CLeglDisplayKHR = *mut c_void;
39
40pub type CLeglSyncKHR = *mut c_void;
42
43pub type cl_egl_image_properties_khr = intptr_t;
45
46pub type clCreateFromEGLImageKHR_t = Option<
47 unsafe extern "C" fn(
48 context: cl_context,
49 egldisplay: CLeglDisplayKHR,
50 eglimage: CLeglImageKHR,
51 flags: cl_mem_flags,
52 properties: *const cl_egl_image_properties_khr,
53 errcode_ret: *mut cl_int,
54 ) -> cl_mem,
55>;
56pub type clCreateFromEGLImageKHR_fn = clCreateFromEGLImageKHR_t;
57
58pub type clEnqueueAcquireEGLObjectsKHR_t = Option<
59 unsafe extern "C" fn(
60 command_queue: cl_command_queue,
61 num_objects: cl_uint,
62 mem_objects: *const cl_mem,
63 num_events_in_wait_list: cl_uint,
64 event_wait_list: *const cl_event,
65 event: *mut cl_event,
66 ) -> cl_int,
67>;
68pub type clEnqueueAcquireEGLObjectsKHR_fn = clEnqueueAcquireEGLObjectsKHR_t;
69
70pub type clEnqueueReleaseEGLObjectsKHR_t = Option<
71 unsafe extern "C" fn(
72 command_queue: cl_command_queue,
73 num_objects: cl_uint,
74 mem_objects: *const cl_mem,
75 num_events_in_wait_list: cl_uint,
76 event_wait_list: *const cl_event,
77 event: *mut cl_event,
78 ) -> cl_int,
79>;
80pub type clEnqueueReleaseEGLObjectsKHR_fn = clEnqueueReleaseEGLObjectsKHR_t;
81
82pub type clCreateEventFromEGLSyncKHR_t = Option<
83 unsafe extern "C" fn(
84 context: cl_context,
85 sync: CLeglSyncKHR,
86 display: CLeglDisplayKHR,
87 errcode_ret: *mut cl_int,
88 ) -> cl_event,
89>;
90pub type clCreateEventFromEGLSyncKHR_fn = clCreateEventFromEGLSyncKHR_t;
91
92#[cfg_attr(not(target_os = "macos"), link(name = "OpenCL"))]
93#[cfg_attr(target_os = "macos", link(name = "OpenCL", kind = "framework"))]
94#[cfg(feature = "static")]
95unsafe extern "system" {
96
97 pub fn clCreateFromEGLImageKHR(
98 context: cl_context,
99 display: CLeglDisplayKHR,
100 image: CLeglImageKHR,
101 flags: cl_mem_flags,
102 properties: *const cl_egl_image_properties_khr,
103 errcode_ret: *mut cl_int,
104 ) -> cl_mem;
105
106 pub fn clEnqueueAcquireEGLObjectsKHR(
107 command_queue: cl_command_queue,
108 num_objects: cl_uint,
109 mem_objects: *const cl_mem,
110 num_events_in_wait_list: cl_uint,
111 event_wait_list: *const cl_event,
112 event: *mut cl_event,
113 ) -> cl_int;
114
115 pub fn clEnqueueReleaseEGLObjectsKHR(
116 command_queue: cl_command_queue,
117 num_objects: cl_uint,
118 mem_objects: *const cl_mem,
119 num_events_in_wait_list: cl_uint,
120 event_wait_list: *const cl_event,
121 event: *mut cl_event,
122 ) -> cl_int;
123
124 pub fn clCreateEventFromEGLSyncKHR(
125 context: cl_context,
126 sync: CLeglSyncKHR,
127 display: CLeglDisplayKHR,
128 errcode_ret: *mut cl_int,
129 ) -> cl_event;
130
131}