Struct rafx_api::extra::swapchain_helper::RafxPresentableFrame
source · pub struct RafxPresentableFrame { /* private fields */ }
Expand description
Represents an acquired image from a swapchain. It can move between threads and be sumitted by any thread. The swapchain helper will not provide another image until this one is presented.
To ease error handling, the swapchain may be submitted with an error. This error will be returned on the next attempt to acquire a swapchain image (i.e. the main thread).
Implementations§
source§impl RafxPresentableFrame
impl RafxPresentableFrame
sourcepub fn rotating_frame_index(&self) -> usize
pub fn rotating_frame_index(&self) -> usize
An index that starts at 0 on the first present and increments every frame, wrapping back to 0 after each swapchain image has been presented once. (See image_count on RafxSwapchainHelper). WARNING: This is not always the returned swapchain image. Swapchain images may be acquired in any order.
pub fn incrementing_frame_index(&self) -> usize
sourcepub fn swapchain_texture(&self) -> &RafxTexture
pub fn swapchain_texture(&self) -> &RafxTexture
Returns the acquired swapchain image
sourcepub fn swapchain(&self) -> &Arc<Mutex<RafxSwapchain>>
pub fn swapchain(&self) -> &Arc<Mutex<RafxSwapchain>>
Returns the swapchain. The swapchain helper code generally assumes ownership/management of the swapchain. Messing with it may invalidate assumptions in the swapchain helper code, so mutating operations on it are not recommended
sourcepub fn present(
self,
queue: &RafxQueue,
command_buffers: &[&RafxCommandBuffer]
) -> RafxResult<RafxPresentSuccessResult>
pub fn present( self, queue: &RafxQueue, command_buffers: &[&RafxCommandBuffer] ) -> RafxResult<RafxPresentSuccessResult>
Submits the given command buffers and schedules the swapchain image to be presented after their completion
sourcepub fn present_with_error(self, queue: &RafxQueue, error: RafxError)
pub fn present_with_error(self, queue: &RafxQueue, error: RafxError)
Presents the current swapchain image and returns the given error during the next image acquisition attempt
pub fn do_present( &mut self, queue: &RafxQueue, command_buffers: &[&RafxCommandBuffer] ) -> RafxResult<RafxPresentSuccessResult>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for RafxPresentableFrame
impl Send for RafxPresentableFrame
impl Sync for RafxPresentableFrame
impl Unpin for RafxPresentableFrame
impl UnwindSafe for RafxPresentableFrame
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.