Trait Swapchain

Source
pub trait Swapchain: VkHandle<Handle = VkSwapchainKHR> + DeviceChild {
    // Required methods
    fn format(&self) -> VkFormat;
    fn size(&self) -> &VkExtent2D;

    // Provided methods
    fn acquire_next(
        &mut self,
        timeout: Option<u64>,
        completion: CompletionHandlerMut<'_>,
    ) -> Result<u32> { ... }
    fn image_count(&self) -> Result<u32> { ... }
    fn images(
        &self,
        sink: &mut [MaybeUninit<VkImage>],
    ) -> Result<(u32, ArrayQueryResult)> { ... }
    fn images_alloc(&self) -> Result<Vec<SwapchainImage<&Self>>>
       where Self: Sized { ... }
}

Required Methods§

Source

fn format(&self) -> VkFormat

Source

fn size(&self) -> &VkExtent2D

Provided Methods§

Source

fn acquire_next( &mut self, timeout: Option<u64>, completion: CompletionHandlerMut<'_>, ) -> Result<u32>

Retrieve the index of the next available presentation image

§Failures

On failure, this command returns

  • VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY
  • VK_ERROR_DEVICE_LOST
  • VK_ERROR_OUT_OF_DATE_KHR
  • VK_ERROR_SURFACE_LOST_KHR
Source

fn image_count(&self) -> Result<u32>

Obtain a count of the array of presentable images associated with a swapchain

§Failures

On failure, this command returns

Source

fn images( &self, sink: &mut [MaybeUninit<VkImage>], ) -> Result<(u32, ArrayQueryResult)>

Obtain the array of presentable images associated with a swapchain

§Failures

On failure, this command returns

Source

fn images_alloc(&self) -> Result<Vec<SwapchainImage<&Self>>>
where Self: Sized,

Obtain the array of presentable images associated with a swapchain

§Failures

On failure, this command returns

  • VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY

Implementations on Foreign Types§

Source§

impl<'s, T> Swapchain for &'s T
where T: Swapchain + ?Sized,

Source§

impl<'s, T> Swapchain for &'s mut T
where T: Swapchain + ?Sized,

Source§

impl<T> Swapchain for Box<T>
where T: Swapchain + ?Sized,

Source§

impl<T> Swapchain for Rc<T>
where T: Swapchain + ?Sized,

Source§

impl<T> Swapchain for Arc<T>
where T: Swapchain + ?Sized,

Source§

impl<T> Swapchain for ManuallyDrop<T>
where T: Swapchain,

Implementors§

Source§

impl<Device, Surface> Swapchain for SurfaceSwapchainObject<Device, Surface>
where Device: Device, Surface: VkHandle<Handle = VkSurfaceKHR>,