[−][src]Trait gfx_hal::window::Swapchain
The Swapchain
is the backend representation of the surface.
It consists of multiple buffers, which will be presented on the surface.
Required methods
unsafe fn acquire_image(
&mut self,
timeout_ns: u64,
semaphore: Option<&B::Semaphore>,
fence: Option<&B::Fence>
) -> Result<(SwapImageIndex, Option<Suboptimal>), AcquireError>
&mut self,
timeout_ns: u64,
semaphore: Option<&B::Semaphore>,
fence: Option<&B::Fence>
) -> Result<(SwapImageIndex, Option<Suboptimal>), AcquireError>
Acquire a new swapchain image for rendering. This needs to be called before presenting.
May fail according to one of the reasons indicated in AcquireError
enum.
Synchronization
The acquired image will not be immediately available when the function returns.
Once available the provided Semaphore
and Fence
will be signaled.
Examples
Provided methods
unsafe fn present<'a, S, Iw>(
&'a self,
present_queue: &mut B::CommandQueue,
image_index: SwapImageIndex,
wait_semaphores: Iw
) -> Result<Option<Suboptimal>, PresentError> where
Self: 'a + Sized + Borrow<B::Swapchain>,
S: 'a + Borrow<B::Semaphore>,
Iw: IntoIterator<Item = &'a S>,
&'a self,
present_queue: &mut B::CommandQueue,
image_index: SwapImageIndex,
wait_semaphores: Iw
) -> Result<Option<Suboptimal>, PresentError> where
Self: 'a + Sized + Borrow<B::Swapchain>,
S: 'a + Borrow<B::Semaphore>,
Iw: IntoIterator<Item = &'a S>,
Present one acquired image.
Safety
The passed queue must support presentation on the surface, which is used for creating this swapchain.
Examples
unsafe fn present_without_semaphores<'a>(
&'a self,
present_queue: &mut B::CommandQueue,
image_index: SwapImageIndex
) -> Result<Option<Suboptimal>, PresentError> where
Self: 'a + Sized + Borrow<B::Swapchain>,
&'a self,
present_queue: &mut B::CommandQueue,
image_index: SwapImageIndex
) -> Result<Option<Suboptimal>, PresentError> where
Self: 'a + Sized + Borrow<B::Swapchain>,
Present one acquired image without any semaphore synchronization.