pub struct FrameTimeline { /* private fields */ }Expand description
Manages triple-buffered frame-in-flight state.
Implementations§
Source§impl FrameTimeline
impl FrameTimeline
pub fn new(max_frames_in_flight: usize) -> Self
pub fn triple_buffered() -> Self
Sourcepub fn begin_frame(&mut self) -> u64
pub fn begin_frame(&mut self) -> u64
Begin recording a new frame. Returns the frame index.
Sourcepub fn submit_frame(&mut self)
pub fn submit_frame(&mut self)
Submit the current frame.
Sourcepub fn complete_frame(&mut self, frame_index: u64)
pub fn complete_frame(&mut self, frame_index: u64)
Mark a frame as complete (GPU finished).
Sourcepub fn current_frame_mut(&mut self) -> &mut FrameState
pub fn current_frame_mut(&mut self) -> &mut FrameState
Get the current recording frame (mutable).
Sourcepub fn current_frame(&self) -> &FrameState
pub fn current_frame(&self) -> &FrameState
Get the current recording frame.
Sourcepub fn completed_frame(&self, frame_index: u64) -> Option<&FrameState>
pub fn completed_frame(&self, frame_index: u64) -> Option<&FrameState>
Get a completed frame by index.
Sourcepub fn frames_in_flight(&self) -> usize
pub fn frames_in_flight(&self) -> usize
Number of frames currently in flight (submitted but not completed).
Sourcepub fn wait_for_available(&self) -> bool
pub fn wait_for_available(&self) -> bool
Wait until a frame slot is available.
pub fn max_frames_in_flight(&self) -> usize
pub fn frame_counter(&self) -> u64
Auto Trait Implementations§
impl Freeze for FrameTimeline
impl RefUnwindSafe for FrameTimeline
impl Send for FrameTimeline
impl Sync for FrameTimeline
impl Unpin for FrameTimeline
impl UnsafeUnpin for FrameTimeline
impl UnwindSafe for FrameTimeline
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
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.