Struct ash::extensions::khr::Swapchain
source · pub struct Swapchain { /* private fields */ }Expand description
Implementations§
source§impl Swapchain
impl Swapchain
sourcepub fn new(instance: &Instance, device: &Device) -> Self
pub fn new(instance: &Instance, device: &Device) -> Self
Warning
Instance functions cannot be loaded from a Device and will always panic when called:
Load this struct using an Instance instead via Self::new_from_instance() if the
above Instance function is called. This will be solved in the next breaking ash
release: https://github.com/ash-rs/ash/issues/727.
sourcepub fn new_from_instance(
entry: &Entry,
instance: &Instance,
device: Device
) -> Self
pub fn new_from_instance( entry: &Entry, instance: &Instance, device: Device ) -> Self
Loads all functions on the Instance instead of Device. This incurs an extra
dispatch table for Device functions but also allows the Instance function to be
loaded instead of always panicking. See also Self::new() for more details.
It is okay to pass vk::Device::null() when this struct is only used to call the
Instance function.
sourcepub unsafe fn create_swapchain(
&self,
create_info: &SwapchainCreateInfoKHR,
allocation_callbacks: Option<&AllocationCallbacks>
) -> VkResult<SwapchainKHR>
pub unsafe fn create_swapchain( &self, create_info: &SwapchainCreateInfoKHR, allocation_callbacks: Option<&AllocationCallbacks> ) -> VkResult<SwapchainKHR>
sourcepub unsafe fn destroy_swapchain(
&self,
swapchain: SwapchainKHR,
allocation_callbacks: Option<&AllocationCallbacks>
)
pub unsafe fn destroy_swapchain( &self, swapchain: SwapchainKHR, allocation_callbacks: Option<&AllocationCallbacks> )
sourcepub unsafe fn get_swapchain_images(
&self,
swapchain: SwapchainKHR
) -> VkResult<Vec<Image>>
pub unsafe fn get_swapchain_images( &self, swapchain: SwapchainKHR ) -> VkResult<Vec<Image>>
sourcepub unsafe fn acquire_next_image(
&self,
swapchain: SwapchainKHR,
timeout: u64,
semaphore: Semaphore,
fence: Fence
) -> VkResult<(u32, bool)>
pub unsafe fn acquire_next_image( &self, swapchain: SwapchainKHR, timeout: u64, semaphore: Semaphore, fence: Fence ) -> VkResult<(u32, bool)>
On success, returns the next image’s index and whether the swapchain is suboptimal for the surface.
https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkAcquireNextImageKHR.html
sourcepub unsafe fn queue_present(
&self,
queue: Queue,
present_info: &PresentInfoKHR
) -> VkResult<bool>
pub unsafe fn queue_present( &self, queue: Queue, present_info: &PresentInfoKHR ) -> VkResult<bool>
On success, returns whether the swapchain is suboptimal for the surface.
https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueuePresentKHR.html
sourcepub unsafe fn get_device_group_present_capabilities(
&self,
device_group_present_capabilities: &mut DeviceGroupPresentCapabilitiesKHR
) -> VkResult<()>
pub unsafe fn get_device_group_present_capabilities( &self, device_group_present_capabilities: &mut DeviceGroupPresentCapabilitiesKHR ) -> VkResult<()>
Only available since Vulkan 1.1.
Also available as DeviceGroup::get_device_group_present_capabilities()
when VK_KHR_surface is enabled.
sourcepub unsafe fn get_device_group_surface_present_modes(
&self,
surface: SurfaceKHR
) -> VkResult<DeviceGroupPresentModeFlagsKHR>
pub unsafe fn get_device_group_surface_present_modes( &self, surface: SurfaceKHR ) -> VkResult<DeviceGroupPresentModeFlagsKHR>
Only available since Vulkan 1.1.
Also available as DeviceGroup::get_device_group_surface_present_modes()
when VK_KHR_surface is enabled.
sourcepub unsafe fn get_physical_device_present_rectangles(
&self,
physical_device: PhysicalDevice,
surface: SurfaceKHR
) -> VkResult<Vec<Rect2D>>
pub unsafe fn get_physical_device_present_rectangles( &self, physical_device: PhysicalDevice, surface: SurfaceKHR ) -> VkResult<Vec<Rect2D>>
Only available since Vulkan 1.1.
Also available as DeviceGroup::get_physical_device_present_rectangles()
when VK_KHR_surface is enabled.
Warning
Function will always panic unless this struct is loaded via Self::new_from_instance().
sourcepub unsafe fn acquire_next_image2(
&self,
acquire_info: &AcquireNextImageInfoKHR
) -> VkResult<(u32, bool)>
pub unsafe fn acquire_next_image2( &self, acquire_info: &AcquireNextImageInfoKHR ) -> VkResult<(u32, bool)>
On success, returns the next image’s index and whether the swapchain is suboptimal for the surface.
Only available since Vulkan 1.1.
Also available as DeviceGroup::acquire_next_image2()
when VK_KHR_swapchain is enabled.
https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkAcquireNextImage2KHR.html