]> git.nega.tv - josh/narcissus/commitdiff
Add xcb, xlib and wayland surface support
authorJoshua Simmons <josh@nega.tv>
Sat, 19 Nov 2022 17:17:58 +0000 (18:17 +0100)
committerJoshua Simmons <josh@nega.tv>
Sat, 19 Nov 2022 21:50:29 +0000 (22:50 +0100)
ffi/vulkan-sys/src/enums.rs
ffi/vulkan-sys/src/flags.rs
ffi/vulkan-sys/src/functions.rs
ffi/vulkan-sys/src/handles.rs
ffi/vulkan-sys/src/lib.rs
ffi/vulkan-sys/src/structs.rs

index e4a1e61561186955107b13523e75d1d9173049a2..2a98f0b979b85eb93f176e6f46b1c76433112aaf 100644 (file)
@@ -1026,6 +1026,12 @@ pub enum StructureType {
     DisplayModeCreateInfoKhr = 1000002000,
     DisplaySurfaceCreateInfoKhr = 1000002001,
     DisplayPresentInfoKhr = 1000003000,
+    // Provided by VK_KHR_xlib_surface
+    XlibSurfaceCreateInfoKHR = 1000004000,
+    // Provided by VK_KHR_xcb_surface
+    XcbSurfaceCreateInfoKHR = 1000005000,
+    // Provided by VK_KHR_wayland_surface
+    WaylandSurfaceCreateInfoKHR = 1000006000,
     DebugReportCallbackCreateInfoExt = 1000011000,
     PipelineRasterizationStateRasterizationOrderAmd = 1000018000,
     DebugMarkerObjectNameInfoExt = 1000022000,
index 9b7afb107fa4db199f10ae9d8beb2b0ca8eb363d..1821fd8bcbc24a831552ae7cd4d472d4375f44dd 100644 (file)
@@ -1,6 +1,15 @@
 #[repr(C)]
 pub struct InstanceCreateFlags(u32);
 
+#[repr(C)]
+pub struct XcbSurfaceCreateFlagsKHR(u32);
+
+#[repr(C)]
+pub struct XlibSurfaceCreateFlagsKHR(u32);
+
+#[repr(C)]
+pub struct WaylandSurfaceCreateFlagsKHR(u32);
+
 #[repr(C)]
 #[derive(Debug)]
 pub struct DeviceCreateFlags(u32);
@@ -864,6 +873,9 @@ impl PipelineStageFlags2 {
 // Impls
 
 // InstanceCreateFlags
+// XcbSurfaceCreateFlagsKHR
+// XlibSurfaceCreateFlagsKHR
+// WaylandSurfaceCreateFlagsKHR
 // SampleCountFlags
 // MemoryPropertyFlags
 // MemoryHeapFlags
@@ -1018,6 +1030,270 @@ impl PipelineStageFlags2 {
 //     }
 // }
 
+impl XcbSurfaceCreateFlagsKHR {
+    #[inline]
+    pub fn from_raw(value: u32) -> Self {
+        Self(value)
+    }
+
+    #[inline]
+    pub fn as_raw(self) -> u32 {
+        self.0
+    }
+
+    #[inline]
+    pub fn intersects(self, rhs: Self) -> bool {
+        self.0 & rhs.0 != 0
+    }
+
+    #[inline]
+    pub fn contains(self, rhs: Self) -> bool {
+        self.0 & rhs.0 == rhs.0
+    }
+
+    #[inline]
+    pub fn cardinality(self) -> u32 {
+        self.0.count_ones()
+    }
+}
+
+impl Clone for XcbSurfaceCreateFlagsKHR {
+    fn clone(&self) -> Self {
+        Self(self.0)
+    }
+}
+
+impl Copy for XcbSurfaceCreateFlagsKHR {}
+
+impl Default for XcbSurfaceCreateFlagsKHR {
+    fn default() -> Self {
+        Self(0)
+    }
+}
+
+impl PartialEq for XcbSurfaceCreateFlagsKHR {
+    fn eq(&self, rhs: &Self) -> bool {
+        self.0 == rhs.0
+    }
+}
+
+impl Eq for XcbSurfaceCreateFlagsKHR {}
+
+impl std::ops::BitOr for XcbSurfaceCreateFlagsKHR {
+    type Output = Self;
+    fn bitor(self, rhs: Self) -> Self::Output {
+        Self(self.0 | rhs.0)
+    }
+}
+
+impl std::ops::BitOrAssign for XcbSurfaceCreateFlagsKHR {
+    fn bitor_assign(&mut self, rhs: Self) {
+        self.0 |= rhs.0
+    }
+}
+
+impl std::ops::BitAnd for XcbSurfaceCreateFlagsKHR {
+    type Output = Self;
+    fn bitand(self, rhs: Self) -> Self::Output {
+        Self(self.0 & rhs.0)
+    }
+}
+
+impl std::ops::BitAndAssign for XcbSurfaceCreateFlagsKHR {
+    fn bitand_assign(&mut self, rhs: Self) {
+        self.0 &= rhs.0
+    }
+}
+
+impl std::ops::BitXor for XcbSurfaceCreateFlagsKHR {
+    type Output = Self;
+    fn bitxor(self, rhs: Self) -> Self::Output {
+        Self(self.0 ^ rhs.0)
+    }
+}
+
+impl std::ops::BitXorAssign for XcbSurfaceCreateFlagsKHR {
+    fn bitxor_assign(&mut self, rhs: Self) {
+        self.0 ^= rhs.0
+    }
+}
+
+impl XlibSurfaceCreateFlagsKHR {
+    #[inline]
+    pub fn from_raw(value: u32) -> Self {
+        Self(value)
+    }
+
+    #[inline]
+    pub fn as_raw(self) -> u32 {
+        self.0
+    }
+
+    #[inline]
+    pub fn intersects(self, rhs: Self) -> bool {
+        self.0 & rhs.0 != 0
+    }
+
+    #[inline]
+    pub fn contains(self, rhs: Self) -> bool {
+        self.0 & rhs.0 == rhs.0
+    }
+
+    #[inline]
+    pub fn cardinality(self) -> u32 {
+        self.0.count_ones()
+    }
+}
+
+impl Clone for XlibSurfaceCreateFlagsKHR {
+    fn clone(&self) -> Self {
+        Self(self.0)
+    }
+}
+
+impl Copy for XlibSurfaceCreateFlagsKHR {}
+
+impl Default for XlibSurfaceCreateFlagsKHR {
+    fn default() -> Self {
+        Self(0)
+    }
+}
+
+impl PartialEq for XlibSurfaceCreateFlagsKHR {
+    fn eq(&self, rhs: &Self) -> bool {
+        self.0 == rhs.0
+    }
+}
+
+impl Eq for XlibSurfaceCreateFlagsKHR {}
+
+impl std::ops::BitOr for XlibSurfaceCreateFlagsKHR {
+    type Output = Self;
+    fn bitor(self, rhs: Self) -> Self::Output {
+        Self(self.0 | rhs.0)
+    }
+}
+
+impl std::ops::BitOrAssign for XlibSurfaceCreateFlagsKHR {
+    fn bitor_assign(&mut self, rhs: Self) {
+        self.0 |= rhs.0
+    }
+}
+
+impl std::ops::BitAnd for XlibSurfaceCreateFlagsKHR {
+    type Output = Self;
+    fn bitand(self, rhs: Self) -> Self::Output {
+        Self(self.0 & rhs.0)
+    }
+}
+
+impl std::ops::BitAndAssign for XlibSurfaceCreateFlagsKHR {
+    fn bitand_assign(&mut self, rhs: Self) {
+        self.0 &= rhs.0
+    }
+}
+
+impl std::ops::BitXor for XlibSurfaceCreateFlagsKHR {
+    type Output = Self;
+    fn bitxor(self, rhs: Self) -> Self::Output {
+        Self(self.0 ^ rhs.0)
+    }
+}
+
+impl std::ops::BitXorAssign for XlibSurfaceCreateFlagsKHR {
+    fn bitxor_assign(&mut self, rhs: Self) {
+        self.0 ^= rhs.0
+    }
+}
+
+impl WaylandSurfaceCreateFlagsKHR {
+    #[inline]
+    pub fn from_raw(value: u32) -> Self {
+        Self(value)
+    }
+
+    #[inline]
+    pub fn as_raw(self) -> u32 {
+        self.0
+    }
+
+    #[inline]
+    pub fn intersects(self, rhs: Self) -> bool {
+        self.0 & rhs.0 != 0
+    }
+
+    #[inline]
+    pub fn contains(self, rhs: Self) -> bool {
+        self.0 & rhs.0 == rhs.0
+    }
+
+    #[inline]
+    pub fn cardinality(self) -> u32 {
+        self.0.count_ones()
+    }
+}
+
+impl Clone for WaylandSurfaceCreateFlagsKHR {
+    fn clone(&self) -> Self {
+        Self(self.0)
+    }
+}
+
+impl Copy for WaylandSurfaceCreateFlagsKHR {}
+
+impl Default for WaylandSurfaceCreateFlagsKHR {
+    fn default() -> Self {
+        Self(0)
+    }
+}
+
+impl PartialEq for WaylandSurfaceCreateFlagsKHR {
+    fn eq(&self, rhs: &Self) -> bool {
+        self.0 == rhs.0
+    }
+}
+
+impl Eq for WaylandSurfaceCreateFlagsKHR {}
+
+impl std::ops::BitOr for WaylandSurfaceCreateFlagsKHR {
+    type Output = Self;
+    fn bitor(self, rhs: Self) -> Self::Output {
+        Self(self.0 | rhs.0)
+    }
+}
+
+impl std::ops::BitOrAssign for WaylandSurfaceCreateFlagsKHR {
+    fn bitor_assign(&mut self, rhs: Self) {
+        self.0 |= rhs.0
+    }
+}
+
+impl std::ops::BitAnd for WaylandSurfaceCreateFlagsKHR {
+    type Output = Self;
+    fn bitand(self, rhs: Self) -> Self::Output {
+        Self(self.0 & rhs.0)
+    }
+}
+
+impl std::ops::BitAndAssign for WaylandSurfaceCreateFlagsKHR {
+    fn bitand_assign(&mut self, rhs: Self) {
+        self.0 &= rhs.0
+    }
+}
+
+impl std::ops::BitXor for WaylandSurfaceCreateFlagsKHR {
+    type Output = Self;
+    fn bitxor(self, rhs: Self) -> Self::Output {
+        Self(self.0 ^ rhs.0)
+    }
+}
+
+impl std::ops::BitXorAssign for WaylandSurfaceCreateFlagsKHR {
+    fn bitxor_assign(&mut self, rhs: Self) {
+        self.0 ^= rhs.0
+    }
+}
+
 impl PipelineStageFlags {
     #[inline]
     pub fn from_raw(value: u32) -> Self {
index f68490a1ae591c536c240d5651140ce329d7f20b..8a258c099a57be32b851c8681a1c76773891c80b 100644 (file)
@@ -40,6 +40,12 @@ pub type FnGetInstanceProcAddr =
 
 pub type FnEnumerateInstanceVersion = extern "system" fn(api_version: &mut u32) -> Result;
 
+pub type FnEnumerateInstanceExtensionProperties = extern "system" fn(
+    layer_name: *const c_char,
+    property_count: &mut u32,
+    properties: *mut ExtensionProperties,
+) -> Result;
+
 pub type FnCreateInstance = extern "system" fn(
     create_info: &InstanceCreateInfo,
     allocator: Option<&AllocationCallbacks>,
@@ -127,6 +133,27 @@ pub type FnGetPhysicalDeviceSurfacePresentModesKHR = extern "system" fn(
     present_modes: *mut PresentModeKHR,
 ) -> Result;
 
+pub type FnCreateXcbSurfaceKHR = extern "system" fn(
+    instance: Instance,
+    create_info: &XcbSurfaceCreateInfoKHR,
+    allocator: Option<&AllocationCallbacks>,
+    surface: &mut SurfaceKHR,
+) -> Result;
+
+pub type FnCreateXlibSurfaceKHR = extern "system" fn(
+    instance: Instance,
+    create_info: &XlibSurfaceCreateInfoKHR,
+    allocator: Option<&AllocationCallbacks>,
+    surface: &mut SurfaceKHR,
+) -> Result;
+
+pub type FnCreateWaylandSurfaceKHR = extern "system" fn(
+    instance: Instance,
+    create_info: &WaylandSurfaceCreateInfoKHR,
+    allocator: Option<&AllocationCallbacks>,
+    surface: &mut SurfaceKHR,
+) -> Result;
+
 pub type FnCreateDevice = extern "system" fn(
     physical_device: PhysicalDevice,
     create_info: &DeviceCreateInfo,
index ebf32d1add91fa8e8ab139c13cdac7bfa0b310d1..85aad43dc476f6c7279aa025b52379d3fbc2f453 100644 (file)
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Instance(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct PhysicalDevice(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Device(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Queue(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct CommandBuffer(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct DeviceMemory(pub u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct CommandPool(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Buffer(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct BufferView(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Image(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct ImageView(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct ShaderModule(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Pipeline(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct PipelineLayout(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Sampler(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct DescriptorSet(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct DescriptorSetLayout(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct DescriptorPool(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Fence(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Semaphore(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Event(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct QueryPool(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct Framebuffer(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct RenderPass(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct PipelineCache(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct DescriptorUpdateTemplate(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct DisplayKHR(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct DisplayModeKHR(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct SurfaceKHR(u64);
 
 #[repr(C)]
-#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, Debug)]
 pub struct SwapchainKHR(u64);
 
 // impl Handle {
index fbec2ff7f21458d49df0288929fedc1d52ae9a64..e515c06b6ff760aa6b2da5e915427acc8e303428 100644 (file)
@@ -303,6 +303,7 @@ fn vulkan_device_version_not_supported() {
 pub struct GlobalFunctions {
     get_instance_proc_addr: FnGetInstanceProcAddr,
     enumerate_instance_version: Option<FnEnumerateInstanceVersion>,
+    enumerate_instance_extension_properties: FnEnumerateInstanceExtensionProperties,
     create_instance: FnCreateInstance,
 }
 
@@ -315,6 +316,10 @@ impl GlobalFunctions {
                 Instance::null(),
                 cstr!("vkEnumerateInstanceVersion").as_ptr(),
             )),
+            enumerate_instance_extension_properties: transmute::<_, _>(get_instance_proc_addr(
+                Instance::null(),
+                cstr!("vkEnumerateInstanceExtensionProperties").as_ptr(),
+            )),
             create_instance: transmute::<_, _>(
                 get_instance_proc_addr(Instance::null(), cstr!("vkCreateInstance").as_ptr())
                     .expect("failed to load vkCreateInstance"),
@@ -341,6 +346,16 @@ impl GlobalFunctions {
         }
     }
 
+    #[inline]
+    pub unsafe fn enumerate_instance_extension_properties(
+        &self,
+        layer_name: *const c_char,
+        property_count: &mut u32,
+        properties: *mut ExtensionProperties,
+    ) -> Result {
+        (self.enumerate_instance_extension_properties)(layer_name, property_count, properties)
+    }
+
     #[inline]
     pub unsafe fn create_instance(
         &self,
@@ -2435,6 +2450,102 @@ impl SurfaceKHRFunctions {
     }
 }
 
+pub struct XcbSurfaceKHRFunctions {
+    create_xcb_surface: FnCreateXcbSurfaceKHR,
+}
+
+impl XcbSurfaceKHRFunctions {
+    pub fn new(global_functions: &GlobalFunctions, instance: Instance) -> Self {
+        unsafe {
+            let load = |name: &CStr| {
+                global_functions
+                    .get_instance_proc_addr(instance, name)
+                    .unwrap_or_else(
+                        #[cold]
+                        || panic!("failed to load device function {}", name.to_string_lossy()),
+                    )
+            };
+            Self {
+                create_xcb_surface: transmute::<_, _>(load(cstr!("vkCreateXcbSurfaceKHR"))),
+            }
+        }
+    }
+
+    pub fn create_xcb_surface(
+        &self,
+        instance: Instance,
+        create_info: &XcbSurfaceCreateInfoKHR,
+        allocator: Option<&AllocationCallbacks>,
+        surface: &mut SurfaceKHR,
+    ) -> Result {
+        (self.create_xcb_surface)(instance, create_info, allocator, surface)
+    }
+}
+
+pub struct XlibSurfaceKHRFunctions {
+    create_xlib_surface: FnCreateXlibSurfaceKHR,
+}
+
+impl XlibSurfaceKHRFunctions {
+    pub fn new(global_functions: &GlobalFunctions, instance: Instance) -> Self {
+        unsafe {
+            let load = |name: &CStr| {
+                global_functions
+                    .get_instance_proc_addr(instance, name)
+                    .unwrap_or_else(
+                        #[cold]
+                        || panic!("failed to load device function {}", name.to_string_lossy()),
+                    )
+            };
+            Self {
+                create_xlib_surface: transmute::<_, _>(load(cstr!("vkCreateXlibSurfaceKHR"))),
+            }
+        }
+    }
+
+    pub fn create_xlib_surface(
+        &self,
+        instance: Instance,
+        create_info: &XlibSurfaceCreateInfoKHR,
+        allocator: Option<&AllocationCallbacks>,
+        surface: &mut SurfaceKHR,
+    ) -> Result {
+        (self.create_xlib_surface)(instance, create_info, allocator, surface)
+    }
+}
+
+pub struct WaylandSurfaceKHRFunctions {
+    create_wayland_surface: FnCreateWaylandSurfaceKHR,
+}
+
+impl WaylandSurfaceKHRFunctions {
+    pub fn new(global_functions: &GlobalFunctions, instance: Instance) -> Self {
+        unsafe {
+            let load = |name: &CStr| {
+                global_functions
+                    .get_instance_proc_addr(instance, name)
+                    .unwrap_or_else(
+                        #[cold]
+                        || panic!("failed to load device function {}", name.to_string_lossy()),
+                    )
+            };
+            Self {
+                create_wayland_surface: transmute::<_, _>(load(cstr!("vkCreateWaylandSurfaceKHR"))),
+            }
+        }
+    }
+
+    pub fn create_wayland_surface(
+        &self,
+        instance: Instance,
+        create_info: &WaylandSurfaceCreateInfoKHR,
+        allocator: Option<&AllocationCallbacks>,
+        surface: &mut SurfaceKHR,
+    ) -> Result {
+        (self.create_wayland_surface)(instance, create_info, allocator, surface)
+    }
+}
+
 pub struct SwapchainKHRFunctions {
     create_swapchain: FnCreateSwapchainKHR,
     destroy_swapchain: FnDestroySwapchainKHR,
index 0c0a1e4b40c44bf3c7ae14615841bbca617b17e2..10a4f8f21a136ecc1843612c491050187c0fbfef 100644 (file)
@@ -67,6 +67,12 @@ pub struct ComponentMapping {
     pub a: ComponentSwizzle,
 }
 
+#[repr(C)]
+pub struct ExtensionProperties {
+    pub extension_name: [u8; 256],
+    pub spec_version: u32,
+}
+
 #[repr(C)]
 pub struct AllocationCallbacks {
     user_data: *mut c_void,
@@ -150,6 +156,57 @@ impl<'a> Default for InstanceCreateInfo<'a> {
     }
 }
 
+#[repr(C)]
+pub struct XcbSurfaceCreateInfoKHR {
+    pub _type: StructureType,
+    pub _next: *const c_void,
+    pub flags: XcbSurfaceCreateFlagsKHR,
+    pub connection: *mut c_void, // xcb_connection_t*
+    pub window: i32,             // xcb_window_t
+}
+
+impl Default for XcbSurfaceCreateInfoKHR {
+    fn default() -> Self {
+        let mut x = unsafe { MaybeUninit::<Self>::zeroed().assume_init() };
+        x._type = StructureType::XcbSurfaceCreateInfoKHR;
+        x
+    }
+}
+
+#[repr(C)]
+pub struct XlibSurfaceCreateInfoKHR {
+    pub _type: StructureType,
+    pub _next: *const c_void,
+    pub flags: XlibSurfaceCreateFlagsKHR,
+    pub display: *mut c_void, // Display*
+    pub window: i32,          // Window
+}
+
+impl Default for XlibSurfaceCreateInfoKHR {
+    fn default() -> Self {
+        let mut x = unsafe { MaybeUninit::<Self>::zeroed().assume_init() };
+        x._type = StructureType::XlibSurfaceCreateInfoKHR;
+        x
+    }
+}
+
+#[repr(C)]
+pub struct WaylandSurfaceCreateInfoKHR {
+    pub _type: StructureType,
+    pub _next: *const c_void,
+    pub flags: WaylandSurfaceCreateFlagsKHR,
+    pub display: *mut c_void, // wl_display*
+    pub surface: *mut c_void, // wl_surface*
+}
+
+impl Default for WaylandSurfaceCreateInfoKHR {
+    fn default() -> Self {
+        let mut x = unsafe { MaybeUninit::<Self>::zeroed().assume_init() };
+        x._type = StructureType::WaylandSurfaceCreateInfoKHR;
+        x
+    }
+}
+
 #[repr(C)]
 #[derive(Copy, Clone, Debug)]
 pub struct QueueFamilyProperties {