diff --git a/vk-sys/src/lib.rs b/vk-sys/src/lib.rs index 2a71bc06..3c8434d8 100644 --- a/vk-sys/src/lib.rs +++ b/vk-sys/src/lib.rs @@ -949,6 +949,8 @@ pub const PRESENT_MODE_IMMEDIATE_KHR: u32 = 0; pub const PRESENT_MODE_MAILBOX_KHR: u32 = 1; pub const PRESENT_MODE_FIFO_KHR: u32 = 2; pub const PRESENT_MODE_FIFO_RELAXED_KHR: u32 = 3; +pub const PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR: u32 = 1000111000; +pub const PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR: u32 = 1000111001; pub type SurfaceTransformFlagBitsKHR = u32; pub const SURFACE_TRANSFORM_IDENTITY_BIT_KHR: u32 = 0x00000001; diff --git a/vulkano/src/swapchain/capabilities.rs b/vulkano/src/swapchain/capabilities.rs index 0c5decb4..6483c889 100644 --- a/vulkano/src/swapchain/capabilities.rs +++ b/vulkano/src/swapchain/capabilities.rs @@ -82,6 +82,11 @@ pub enum PresentMode { /// /// This is the equivalent of OpenGL's `SwapInterval` with a value of -1. Relaxed = vk::PRESENT_MODE_FIFO_RELAXED_KHR, + + // TODO: These can't be enabled yet because they have to be used with shared present surfaces + // which vulkano doesnt support yet. + //SharedDemand = vk::PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR, + //SharedContinuous = vk::PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR, } /// List of `PresentMode`s that are supported. @@ -91,6 +96,8 @@ pub struct SupportedPresentModes { pub mailbox: bool, pub fifo: bool, pub relaxed: bool, + pub shared_demand: bool, + pub shared_continuous: bool, } pub fn supported_present_modes_from_list(elem: I) -> SupportedPresentModes @@ -103,7 +110,9 @@ pub fn supported_present_modes_from_list(elem: I) -> SupportedPresentModes vk::PRESENT_MODE_MAILBOX_KHR => result.mailbox = true, vk::PRESENT_MODE_FIFO_KHR => result.fifo = true, vk::PRESENT_MODE_FIFO_RELAXED_KHR => result.relaxed = true, - _ => panic!("Wrong value for vk::PresentModeKHR"), + vk::PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR => result.shared_demand = true, + vk::PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR => result.shared_continuous = true, + _ => { } } } result @@ -118,6 +127,8 @@ impl SupportedPresentModes { mailbox: false, fifo: false, relaxed: false, + shared_demand: false, + shared_continuous: false, } }