1#![allow(non_camel_case_types, non_upper_case_globals)]
21
22use super::cl::{
23 cl_command_queue, cl_command_type, cl_context, cl_context_info, cl_device_id, cl_event,
24 cl_image_info, cl_mem, cl_mem_flags, cl_mem_info, cl_mem_object_type, cl_platform_id,
25};
26use super::cl_platform::{DXGI_FORMAT, cl_int, cl_uint};
27use libc::c_void;
28
29pub type cl_d3d10_device_source_khr = cl_uint;
32pub type cl_d3d10_device_set_khr = cl_uint;
33
34pub const CL_INVALID_D3D10_DEVICE_KHR: cl_int = -1002;
36pub const CL_INVALID_D3D10_RESOURCE_KHR: cl_int = -1003;
37pub const CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR: cl_int = -1004;
38pub const CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR: cl_int = -1005;
39
40pub const CL_D3D10_DEVICE_KHR: cl_d3d10_device_source_khr = 0x4010;
42pub const CL_D3D10_DXGI_ADAPTER_KHR: cl_d3d10_device_source_khr = 0x4011;
43
44pub const CL_PREFERRED_DEVICES_FOR_D3D10_KHR: cl_d3d10_device_set_khr = 0x4012;
46pub const CL_ALL_DEVICES_FOR_D3D10_KHR: cl_d3d10_device_set_khr = 0x4013;
47
48pub const CL_CONTEXT_D3D10_DEVICE_KHR: cl_context_info = 0x4014;
50pub const CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR: cl_context_info = 0x402C;
51
52pub const CL_MEM_D3D10_RESOURCE_KHR: cl_mem_info = 0x4015;
54
55pub const CL_IMAGE_D3D10_SUBRESOURCE_KHR: cl_image_info = 0x4016;
57
58pub const CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR: cl_command_type = 0x4017;
60pub const CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR: cl_command_type = 0x4018;
61
62pub type ID3D10Buffer_ptr = *mut c_void;
63pub type ID3D10Texture2D_ptr = *mut c_void;
64pub type ID3D10Texture3D_ptr = *mut c_void;
65
66pub type clGetDeviceIDsFromD3D10KHR_t = Option<
67 unsafe extern "C" fn(
68 platform: cl_platform_id,
69 d3d_device_source: cl_d3d10_device_source_khr,
70 d3d_object: *mut c_void,
71 d3d_device_set: cl_d3d10_device_set_khr,
72 num_entries: cl_uint,
73 devices: *mut cl_device_id,
74 num_devices: *mut cl_uint,
75 ) -> cl_int,
76>;
77pub type clGetDeviceIDsFromD3D10KHR_fn = clGetDeviceIDsFromD3D10KHR_t;
78
79pub type clCreateFromD3D10BufferKHR_t = Option<
80 unsafe extern "C" fn(
81 context: cl_context,
82 flags: cl_mem_flags,
83 resource: ID3D10Buffer_ptr,
84 errcode_ret: *mut cl_int,
85 ) -> cl_mem,
86>;
87pub type clCreateFromD3D10BufferKHR_fn = clCreateFromD3D10BufferKHR_t;
88
89pub type clCreateFromD3D10Texture2DKHR_t = Option<
90 unsafe extern "C" fn(
91 context: cl_context,
92 flags: cl_mem_flags,
93 resource: ID3D10Texture2D_ptr,
94 subresource: cl_uint,
95 errcode_ret: *mut cl_int,
96 ) -> cl_mem,
97>;
98pub type clCreateFromD3D10Texture2DKHR_fn = clCreateFromD3D10Texture2DKHR_t;
99
100pub type clCreateFromD3D10Texture3DKHR_t = Option<
101 unsafe extern "C" fn(
102 context: cl_context,
103 flags: cl_mem_flags,
104 resource: ID3D10Texture3D_ptr,
105 subresource: cl_uint,
106 errcode_ret: *mut cl_int,
107 ) -> cl_mem,
108>;
109pub type clCreateFromD3D10Texture3DKHR_fn = clCreateFromD3D10Texture3DKHR_t;
110
111pub type clEnqueueAcquireD3D10ObjectsKHR_t = Option<
112 unsafe extern "C" fn(
113 command_queue: cl_command_queue,
114 num_objects: cl_uint,
115 mem_objects: *const cl_mem,
116 num_events_in_wait_list: cl_uint,
117 event_wait_list: *const cl_event,
118 event: *mut cl_event,
119 ) -> cl_int,
120>;
121pub type clEnqueueAcquireD3D10ObjectsKHR_fn = clEnqueueAcquireD3D10ObjectsKHR_t;
122
123pub type clEnqueueReleaseD3D10ObjectsKHR_t = Option<
124 unsafe extern "C" fn(
125 command_queue: cl_command_queue,
126 num_objects: cl_uint,
127 mem_objects: *const cl_mem,
128 num_events_in_wait_list: cl_uint,
129 event_wait_list: *const cl_event,
130 event: *mut cl_event,
131 ) -> cl_int,
132>;
133pub type clEnqueueReleaseD3D10ObjectsKHR_fn = clEnqueueReleaseD3D10ObjectsKHR_t;
134
135pub type clGetSupportedD3D10TextureFormatsINTEL_t = Option<
138 unsafe extern "C" fn(
139 context: cl_context,
140 flags: cl_mem_flags,
141 image_type: cl_mem_object_type,
142 num_entries: cl_uint,
143 d3d10_formats: *mut DXGI_FORMAT,
144 num_surface_formats: *mut cl_uint,
145 ) -> cl_int,
146>;
147
148pub type clGetSupportedD3D10TextureFormatsINTEL_fn = clGetSupportedD3D10TextureFormatsINTEL_t;
149
150#[cfg_attr(not(target_os = "macos"), link(name = "OpenCL"))]
151#[cfg_attr(target_os = "macos", link(name = "OpenCL", kind = "framework"))]
152#[cfg(feature = "cl_khr_d3d10_sharing")]
153#[cfg(feature = "static")]
154unsafe extern "system" {
155
156 pub fn clGetSupportedD3D10TextureFormatsINTEL(
157 context: cl_context,
158 flags: cl_mem_flags,
159 image_type: cl_mem_object_type,
160 num_entries: cl_uint,
161 d3d10_formats: *mut DXGI_FORMAT,
162 num_surface_formats: *mut cl_uint,
163 ) -> cl_int;
164}