use core;
use utils;
use vks;
gen_chain_struct! {
name: DisplayPresentInfoChainKhr [DisplayPresentInfoChainKhrWrapper],
query: DisplayPresentInfoChainQueryKhr [DisplayPresentInfoChainQueryKhrWrapper],
vks: VkDisplayPresentInfoKHR,
input: true,
output: false,
}
#[derive(Debug, Clone, PartialEq)]
pub struct DisplayPresentInfoKhr {
pub src_rect: core::Rect2D,
pub dst_rect: core::Rect2D,
pub persistent: bool,
pub chain: Option<DisplayPresentInfoChainKhr>,
}
#[derive(Debug)]
pub(crate) struct VkDisplayPresentInfoKHRWrapper {
pub vks_struct: vks::VkDisplayPresentInfoKHR,
chain: Option<DisplayPresentInfoChainKhrWrapper>,
}
impl VkDisplayPresentInfoKHRWrapper {
pub fn new(info: &DisplayPresentInfoKhr, with_chain: bool) -> Self {
let (pnext, chain) = DisplayPresentInfoChainKhrWrapper::new_optional(&info.chain, with_chain);
VkDisplayPresentInfoKHRWrapper {
vks_struct: vks::VkDisplayPresentInfoKHR {
sType: vks::VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR,
pNext: pnext,
srcRect: (&info.src_rect).into(),
dstRect: (&info.dst_rect).into(),
persistent: utils::to_vk_bool(info.persistent),
},
chain: chain,
}
}
}