You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

47 lines
923 B

use ash::vk;
use std::num::NonZeroUsize;
serialize! {
conf_enum:
#[derive(Clone, Copy)]
pub enum PresentMode {
Immediate,
Mailbox,
Fifo,
FifoRelaxed,
}
}
serialize! {
conf:
pub struct Conf {
pub device: usize,
pub validation_layers: bool,
pub swap_mode: PresentMode,
pub concurrent_frames: NonZeroUsize,
}
}
impl Into<vk::PresentModeKHR> for PresentMode {
fn into(self) -> vk::PresentModeKHR {
match self {
Self::Immediate => vk::PresentModeKHR::IMMEDIATE,
Self::Mailbox => vk::PresentModeKHR::MAILBOX,
Self::Fifo => vk::PresentModeKHR::FIFO,
Self::FifoRelaxed => vk::PresentModeKHR::FIFO_RELAXED,
}
}
}
impl Default for Conf {
fn default() -> Self {
Self {
device: 0,
validation_layers: cfg!(debug_assertions),
swap_mode: PresentMode::Mailbox,
concurrent_frames: NonZeroUsize::new(2).unwrap(),
}
}
}
// EOF