covk 0.1.2-1.4.346

Unsafe vulkan bindings for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
// generated file, do not modify manually
#![allow(unused_qualifications)]
#![allow(mismatched_lifetime_syntaxes)]
use crate::sys;
use crate::sys::ffi::*;
use crate::vk::*;
use crate::vk;
use crate::{Abi, Vk, Sys};

/// `VK_NV_external_sci_sync` InstanceCommands
#[derive(Debug, Clone, Copy)]
pub struct Instance(pub sys::nv::external_sci_sync::InstanceCommands);

impl Instance {
    pub fn load(get: impl FnMut(&::core::ffi::CStr) -> Option<crate::ProcAddr>) -> Self {
        Self(unsafe { sys::nv::external_sci_sync::InstanceCommands::load(get) })
    }
}

impl Instance {
    /// ```c
    /// VkResult vkGetPhysicalDeviceSciSyncAttributesNV(VkPhysicalDevice physicalDevice, VkSciSyncAttributesInfoNV const* pSciSyncAttributesInfo, NvSciSyncAttrList pAttributes)
    /// ```
    pub unsafe fn get_physical_device_sci_sync_attributes(
        &self,
        physical_device: vk::PhysicalDevice,
        sci_sync_attributes_info: &SciSyncAttributesInfoNV,
        attributes: NvSciSyncAttrList,
    ) -> crate::Result<()> {
        unsafe {
            let _r = self.0.GetPhysicalDeviceSciSyncAttributesNV(
                physical_device.abi(), 
                sci_sync_attributes_info.abi(), 
                attributes.abi(), 
            ).vk();
            _r.result(|| Some(()))
        }
    }
}

impl crate::CommandScope<vk::Instance> for vk::extensions::nv::external_sci_sync {
    type Commands = Instance;
}

/// Instance object
pub trait NvExternalSciSyncInstance {
    fn raw(&self) -> vk::Instance;
    fn commands(&self) -> &Instance;

}

impl crate::HndScope<vk::Instance> for vk::extensions::nv::external_sci_sync {
    type Impl = _hs_Instance::Instance;
}

mod _hs_Instance {
    use super::*;
    #[derive(Debug)]
    pub struct Instance(pub(crate) ::alloc::sync::Arc<super::Instance>, pub(crate) crate::hnd::Instance<vk::core>);

    impl Clone for Instance {
        fn clone(&self) -> Self { Self(self.0.clone(), self.1.clone()) }
    }

    impl crate::hnd::Instance<vk::extensions::nv::external_sci_sync> {
        pub unsafe fn new(base: &crate::hnd::Instance<vk::core>) -> Self {
            unsafe {
                Self(Instance(
                   ::alloc::sync::Arc::new(super::Instance::load(|name| unsafe { base.get_proc_addr(name) })),
                   base.clone(),
                ))
            }
        }
    }

    impl crate::Extension<crate::hnd::Instance<vk::core>> for vk::extensions::nv::external_sci_sync {
        type Output = crate::hnd::Instance<vk::extensions::nv::external_sci_sync>;
        unsafe fn make(target: &crate::hnd::Instance<vk::core>) -> Self::Output {
            unsafe { crate::hnd::Instance::<vk::extensions::nv::external_sci_sync>::new(target) }
        }
    }

    impl crate::hnd::Instance<vk::extensions::nv::external_sci_sync> {
        pub fn raw(&self) -> vk::Instance { self.0.1.raw() }
        pub fn commands(&self) -> &::alloc::sync::Arc<super::Instance> { &self.0.0 }
        pub fn core(&self) -> &crate::hnd::Instance<vk::core> { &self.0.1 }
    }

    impl ::core::fmt::Debug for crate::hnd::Instance<vk::extensions::nv::external_sci_sync> {
        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
            f.write_fmt(format_args!("Instance({:p})", self.raw()))
        }
    }

    impl ::core::fmt::Pointer for crate::hnd::Instance<vk::extensions::nv::external_sci_sync> {
        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
            self.raw().fmt(f)
        }
    }

    impl ::core::ops::Deref for crate::hnd::Instance<vk::extensions::nv::external_sci_sync> {
        type Target = super::Instance;
        fn deref(&self) -> &Self::Target { self.commands() }
    }

    impl super::NvExternalSciSyncInstance for crate::hnd::Instance<vk::extensions::nv::external_sci_sync> {
        fn raw(&self) -> vk::Instance { self.raw() }
        fn commands(&self) -> &super::Instance { self.commands() }
    }

    impl crate::HndCtx<vk::extensions::nv::external_sci_sync, vk::Instance> for crate::hnd::Instance<vk::extensions::nv::external_sci_sync> {
        type Ctx = Self;
        fn ctx(&self) -> Self::Ctx { self.clone() }
        fn raw(&self) -> vk::Instance { self.raw() }
        fn commands(&self) -> &::alloc::sync::Arc<super::Instance> { self.commands() }
    }
}

/// PhysicalDevice object
pub trait NvExternalSciSyncPhysicalDevice {
    fn raw(&self) -> vk::PhysicalDevice;
    fn commands(&self) -> &Instance;

    /// ```c
    /// VkResult vkGetPhysicalDeviceSciSyncAttributesNV(VkPhysicalDevice physicalDevice, VkSciSyncAttributesInfoNV const* pSciSyncAttributesInfo, NvSciSyncAttrList pAttributes)
    /// ```
    unsafe fn get_sci_sync_attributes(
        &self,
        sci_sync_attributes_info: &SciSyncAttributesInfoNV,
        attributes: NvSciSyncAttrList,
    ) -> crate::Result<()> {
        unsafe {
            self.commands().get_physical_device_sci_sync_attributes(
                self.raw(),
                sci_sync_attributes_info,
                attributes,
            )
        }
    }
}

/// `VK_NV_external_sci_sync` DeviceCommands
#[derive(Debug, Clone, Copy)]
pub struct Device(pub sys::nv::external_sci_sync::DeviceCommands);

impl Device {
    pub fn load(get: impl FnMut(&::core::ffi::CStr) -> Option<crate::ProcAddr>) -> Self {
        Self(unsafe { sys::nv::external_sci_sync::DeviceCommands::load(get) })
    }
}

impl Device {
    /// ```c
    /// VkResult vkGetFenceSciSyncFenceNV(VkDevice device, VkFenceGetSciSyncInfoNV const* pGetSciSyncHandleInfo, void* pHandle)
    /// ```
    pub unsafe fn get_fence_sci_sync_fence(
        &self,
        device: vk::Device,
        get_sci_sync_handle_info: &FenceGetSciSyncInfoNV,
        handle: *mut void,
    ) -> crate::Result<()> {
        unsafe {
            let _r = self.0.GetFenceSciSyncFenceNV(
                device.abi(), 
                get_sci_sync_handle_info.abi(), 
                handle.abi(), 
            ).vk();
            _r.result(|| Some(()))
        }
    }
    /// ```c
    /// VkResult vkGetFenceSciSyncObjNV(VkDevice device, VkFenceGetSciSyncInfoNV const* pGetSciSyncHandleInfo, void* pHandle)
    /// ```
    pub unsafe fn get_fence_sci_sync_obj(
        &self,
        device: vk::Device,
        get_sci_sync_handle_info: &FenceGetSciSyncInfoNV,
        handle: *mut void,
    ) -> crate::Result<()> {
        unsafe {
            let _r = self.0.GetFenceSciSyncObjNV(
                device.abi(), 
                get_sci_sync_handle_info.abi(), 
                handle.abi(), 
            ).vk();
            _r.result(|| Some(()))
        }
    }
    /// ```c
    /// VkResult vkGetSemaphoreSciSyncObjNV(VkDevice device, VkSemaphoreGetSciSyncInfoNV const* pGetSciSyncInfo, void* pHandle)
    /// ```
    pub unsafe fn get_semaphore_sci_sync_obj(
        &self,
        device: vk::Device,
        get_sci_sync_info: &SemaphoreGetSciSyncInfoNV,
        handle: *mut void,
    ) -> crate::Result<()> {
        unsafe {
            let _r = self.0.GetSemaphoreSciSyncObjNV(
                device.abi(), 
                get_sci_sync_info.abi(), 
                handle.abi(), 
            ).vk();
            _r.result(|| Some(()))
        }
    }
    /// ```c
    /// VkResult vkImportFenceSciSyncFenceNV(VkDevice device, VkImportFenceSciSyncInfoNV const* pImportFenceSciSyncInfo)
    /// ```
    pub unsafe fn import_fence_sci_sync_fence(
        &self,
        device: vk::Device,
        import_fence_sci_sync_info: &ImportFenceSciSyncInfoNV,
    ) -> crate::Result<()> {
        unsafe {
            let _r = self.0.ImportFenceSciSyncFenceNV(
                device.abi(), 
                import_fence_sci_sync_info.abi(), 
            ).vk();
            _r.result(|| Some(()))
        }
    }
    /// ```c
    /// VkResult vkImportFenceSciSyncObjNV(VkDevice device, VkImportFenceSciSyncInfoNV const* pImportFenceSciSyncInfo)
    /// ```
    pub unsafe fn import_fence_sci_sync_obj(
        &self,
        device: vk::Device,
        import_fence_sci_sync_info: &ImportFenceSciSyncInfoNV,
    ) -> crate::Result<()> {
        unsafe {
            let _r = self.0.ImportFenceSciSyncObjNV(
                device.abi(), 
                import_fence_sci_sync_info.abi(), 
            ).vk();
            _r.result(|| Some(()))
        }
    }
    /// ```c
    /// VkResult vkImportSemaphoreSciSyncObjNV(VkDevice device, VkImportSemaphoreSciSyncInfoNV const* pImportSemaphoreSciSyncInfo)
    /// ```
    pub unsafe fn import_semaphore_sci_sync_obj(
        &self,
        device: vk::Device,
        import_semaphore_sci_sync_info: &ImportSemaphoreSciSyncInfoNV,
    ) -> crate::Result<()> {
        unsafe {
            let _r = self.0.ImportSemaphoreSciSyncObjNV(
                device.abi(), 
                import_semaphore_sci_sync_info.abi(), 
            ).vk();
            _r.result(|| Some(()))
        }
    }
}

impl crate::CommandScope<vk::Device> for vk::extensions::nv::external_sci_sync {
    type Commands = Device;
}

/// Device object
pub trait NvExternalSciSyncDevice {
    fn raw(&self) -> vk::Device;
    fn commands(&self) -> &Device;

    /// ```c
    /// VkResult vkGetFenceSciSyncFenceNV(VkDevice device, VkFenceGetSciSyncInfoNV const* pGetSciSyncHandleInfo, void* pHandle)
    /// ```
    unsafe fn get_fence_sci_sync_fence(
        &self,
        get_sci_sync_handle_info: &FenceGetSciSyncInfoNV,
        handle: *mut void,
    ) -> crate::Result<()> {
        unsafe {
            self.commands().get_fence_sci_sync_fence(
                self.raw(),
                get_sci_sync_handle_info,
                handle,
            )
        }
    }
    /// ```c
    /// VkResult vkGetFenceSciSyncObjNV(VkDevice device, VkFenceGetSciSyncInfoNV const* pGetSciSyncHandleInfo, void* pHandle)
    /// ```
    unsafe fn get_fence_sci_sync_obj(
        &self,
        get_sci_sync_handle_info: &FenceGetSciSyncInfoNV,
        handle: *mut void,
    ) -> crate::Result<()> {
        unsafe {
            self.commands().get_fence_sci_sync_obj(
                self.raw(),
                get_sci_sync_handle_info,
                handle,
            )
        }
    }
    /// ```c
    /// VkResult vkGetSemaphoreSciSyncObjNV(VkDevice device, VkSemaphoreGetSciSyncInfoNV const* pGetSciSyncInfo, void* pHandle)
    /// ```
    unsafe fn get_semaphore_sci_sync_obj(
        &self,
        get_sci_sync_info: &SemaphoreGetSciSyncInfoNV,
        handle: *mut void,
    ) -> crate::Result<()> {
        unsafe {
            self.commands().get_semaphore_sci_sync_obj(
                self.raw(),
                get_sci_sync_info,
                handle,
            )
        }
    }
    /// ```c
    /// VkResult vkImportFenceSciSyncFenceNV(VkDevice device, VkImportFenceSciSyncInfoNV const* pImportFenceSciSyncInfo)
    /// ```
    unsafe fn import_fence_sci_sync_fence(
        &self,
        import_fence_sci_sync_info: &ImportFenceSciSyncInfoNV,
    ) -> crate::Result<()> {
        unsafe {
            self.commands().import_fence_sci_sync_fence(
                self.raw(),
                import_fence_sci_sync_info,
            )
        }
    }
    /// ```c
    /// VkResult vkImportFenceSciSyncObjNV(VkDevice device, VkImportFenceSciSyncInfoNV const* pImportFenceSciSyncInfo)
    /// ```
    unsafe fn import_fence_sci_sync_obj(
        &self,
        import_fence_sci_sync_info: &ImportFenceSciSyncInfoNV,
    ) -> crate::Result<()> {
        unsafe {
            self.commands().import_fence_sci_sync_obj(
                self.raw(),
                import_fence_sci_sync_info,
            )
        }
    }
    /// ```c
    /// VkResult vkImportSemaphoreSciSyncObjNV(VkDevice device, VkImportSemaphoreSciSyncInfoNV const* pImportSemaphoreSciSyncInfo)
    /// ```
    unsafe fn import_semaphore_sci_sync_obj(
        &self,
        import_semaphore_sci_sync_info: &ImportSemaphoreSciSyncInfoNV,
    ) -> crate::Result<()> {
        unsafe {
            self.commands().import_semaphore_sci_sync_obj(
                self.raw(),
                import_semaphore_sci_sync_info,
            )
        }
    }
}

impl crate::HndScope<vk::Device> for vk::extensions::nv::external_sci_sync {
    type Impl = _hs_Device::Device;
}

mod _hs_Device {
    use super::*;
    #[derive(Debug)]
    pub struct Device(pub(crate) ::alloc::sync::Arc<super::Device>, pub(crate) crate::hnd::Device<vk::core>);

    impl Clone for Device {
        fn clone(&self) -> Self { Self(self.0.clone(), self.1.clone()) }
    }

    impl crate::hnd::Device<vk::extensions::nv::external_sci_sync> {
        pub unsafe fn new(base: &crate::hnd::Device<vk::core>) -> Self {
            unsafe {
                Self(Device(
                   ::alloc::sync::Arc::new(super::Device::load(|name| unsafe { base.get_proc_addr(name) })),
                   base.clone(),
                ))
            }
        }
    }

    impl crate::Extension<crate::hnd::Device<vk::core>> for vk::extensions::nv::external_sci_sync {
        type Output = crate::hnd::Device<vk::extensions::nv::external_sci_sync>;
        unsafe fn make(target: &crate::hnd::Device<vk::core>) -> Self::Output {
            unsafe { crate::hnd::Device::<vk::extensions::nv::external_sci_sync>::new(target) }
        }
    }

    impl crate::hnd::Device<vk::extensions::nv::external_sci_sync> {
        pub fn raw(&self) -> vk::Device { self.0.1.raw() }
        pub fn commands(&self) -> &::alloc::sync::Arc<super::Device> { &self.0.0 }
        pub fn core(&self) -> &crate::hnd::Device<vk::core> { &self.0.1 }
    }

    impl ::core::fmt::Debug for crate::hnd::Device<vk::extensions::nv::external_sci_sync> {
        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
            f.write_fmt(format_args!("Device({:p})", self.raw()))
        }
    }

    impl ::core::fmt::Pointer for crate::hnd::Device<vk::extensions::nv::external_sci_sync> {
        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
            self.raw().fmt(f)
        }
    }

    impl ::core::ops::Deref for crate::hnd::Device<vk::extensions::nv::external_sci_sync> {
        type Target = super::Device;
        fn deref(&self) -> &Self::Target { self.commands() }
    }

    impl super::NvExternalSciSyncDevice for crate::hnd::Device<vk::extensions::nv::external_sci_sync> {
        fn raw(&self) -> vk::Device { self.raw() }
        fn commands(&self) -> &super::Device { self.commands() }
    }

    impl crate::HndCtx<vk::extensions::nv::external_sci_sync, vk::Device> for crate::hnd::Device<vk::extensions::nv::external_sci_sync> {
        type Ctx = Self;
        fn ctx(&self) -> Self::Ctx { self.clone() }
        fn raw(&self) -> vk::Device { self.raw() }
        fn commands(&self) -> &::alloc::sync::Arc<super::Device> { self.commands() }
    }
}