#![allow(unused_imports)]
use crate::{vk::Result as VkResult, vk::*, *};
use core::ffi::{CStr, c_char, c_int, c_void};
use core::mem::transmute;
use core::ptr;
pub const EXTENSION_NAME: &CStr = c"VK_EXT_swapchain_maintenance1";
pub(super) mod defs {
#![allow(non_camel_case_types, unused_imports)]
use crate::{vk::*, *};
use core::ffi::{CStr, c_char, c_int, c_void};
use core::fmt;
use core::marker::PhantomData;
use core::ptr;
pub type PhysicalDeviceSwapchainMaintenance1FeaturesEXT<'a> =
PhysicalDeviceSwapchainMaintenance1FeaturesKHR<'a>;
pub type SwapchainPresentFenceInfoEXT<'a> = SwapchainPresentFenceInfoKHR<'a>;
pub type SwapchainPresentModesCreateInfoEXT<'a> = SwapchainPresentModesCreateInfoKHR<'a>;
pub type SwapchainPresentModeInfoEXT<'a> = SwapchainPresentModeInfoKHR<'a>;
pub type SwapchainPresentScalingCreateInfoEXT<'a> = SwapchainPresentScalingCreateInfoKHR<'a>;
pub type ReleaseSwapchainImagesInfoEXT<'a> = ReleaseSwapchainImagesInfoKHR<'a>;
pub type PFN_vkReleaseSwapchainImagesEXT = PFN_vkReleaseSwapchainImagesKHR;
}
#[cfg(feature = "ffi")]
pub(super) mod ffi {
#![allow(non_camel_case_types)]
use super::defs::*;
pub type VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT =
PhysicalDeviceSwapchainMaintenance1FeaturesEXT<'static>;
pub type VkSwapchainPresentFenceInfoEXT = SwapchainPresentFenceInfoEXT<'static>;
pub type VkSwapchainPresentModesCreateInfoEXT = SwapchainPresentModesCreateInfoEXT<'static>;
pub type VkSwapchainPresentModeInfoEXT = SwapchainPresentModeInfoEXT<'static>;
pub type VkSwapchainPresentScalingCreateInfoEXT = SwapchainPresentScalingCreateInfoEXT<'static>;
pub type VkReleaseSwapchainImagesInfoEXT = ReleaseSwapchainImagesInfoEXT<'static>;
}
pub struct DeviceFn {
release_swapchain_images: PFN_vkReleaseSwapchainImagesKHR,
}
impl LoadDeviceFn for DeviceFn {
unsafe fn load_with(
load: impl Fn(&CStr) -> Option<PFN_vkVoidFunction>,
) -> core::result::Result<Self, MissingEntryPointError> {
unsafe {
Ok(Self {
release_swapchain_images: transmute(
load(c"vkReleaseSwapchainImagesEXT").ok_or(MissingEntryPointError)?,
),
})
}
}
}
impl DeviceFn {
#[inline]
pub unsafe fn release_swapchain_images(
&self,
device: Device,
release_info: &ReleaseSwapchainImagesInfoKHR<'_>,
) -> crate::Result<()> {
unsafe {
let result = (self.release_swapchain_images)(device, release_info);
match result {
VkResult::SUCCESS => Ok(()),
err => Err(err),
}
}
}
}