vks/
khr_external_semaphore_fd.rs1use core::ptr;
18use khr_external_semaphore;
19use khr_external_semaphore_capabilities;
20use libc::{c_int, c_void};
21use vk;
22
23pub const VK_KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION: u32 = 1;
24pub const VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME: &'static [u8; 29] = b"VK_KHR_external_semaphore_fd\x00";
25pub const VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME_STR: &'static str = "VK_KHR_external_semaphore_fd";
26
27#[repr(C)]
29#[derive(Debug, Copy, Clone)]
30pub struct VkImportSemaphoreFdInfoKHR {
31 pub sType: vk::VkStructureType,
32 pub pNext: *const c_void,
33 pub semaphore: vk::VkSemaphore,
34 pub flags: khr_external_semaphore::VkSemaphoreImportFlagsKHR,
35 pub handleType: khr_external_semaphore_capabilities::VkExternalSemaphoreHandleTypeFlagBitsKHR,
36 pub fd: c_int,
37}
38
39impl Default for VkImportSemaphoreFdInfoKHR {
40 fn default() -> Self {
41 VkImportSemaphoreFdInfoKHR {
42 sType: vk::VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR,
43 pNext: ptr::null(),
44 semaphore: Default::default(),
45 flags: Default::default(),
46 handleType: Default::default(),
47 fd: Default::default(),
48 }
49 }
50}
51
52#[repr(C)]
54#[derive(Debug, Copy, Clone)]
55pub struct VkSemaphoreGetFdInfoKHR {
56 pub sType: vk::VkStructureType,
57 pub pNext: *const c_void,
58 pub semaphore: vk::VkSemaphore,
59 pub handleType: khr_external_semaphore_capabilities::VkExternalSemaphoreHandleTypeFlagBitsKHR,
60}
61
62impl Default for VkSemaphoreGetFdInfoKHR {
63 fn default() -> Self {
64 VkSemaphoreGetFdInfoKHR {
65 sType: vk::VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR,
66 pNext: ptr::null(),
67 semaphore: Default::default(),
68 handleType: Default::default(),
69 }
70 }
71}
72
73pub type PFN_vkImportSemaphoreFdKHR = Option<unsafe extern "system" fn(device: vk::VkDevice, pImportSemaphoreFdInfo: *const VkImportSemaphoreFdInfoKHR) -> vk::VkResult>;
75
76pub type PFN_vkGetSemaphoreFdKHR = Option<unsafe extern "system" fn(device: vk::VkDevice, pGetFdInfo: *const VkSemaphoreGetFdInfoKHR, pFd: *mut c_int) -> vk::VkResult>;
78
79#[cfg(feature = "function_prototypes")]
80extern "system" {
81 pub fn vkImportSemaphoreFdKHR(device: vk::VkDevice, pImportSemaphoreFdInfo: *const VkImportSemaphoreFdInfoKHR) -> vk::VkResult;
83
84 pub fn vkGetSemaphoreFdKHR(device: vk::VkDevice, pGetFdInfo: *const VkSemaphoreGetFdInfoKHR, pFd: *mut c_int) -> vk::VkResult;
86}