pub struct FrameTimeline { /* private fields */ }Expand description
Per-frame resource versioning for safe concurrent GPU/CPU access.
Maintains a ring of frame contexts. Each frame has its own fence so we know when it’s safe to reuse that frame’s resources.
Implementations§
Source§impl FrameTimeline
impl FrameTimeline
Sourcepub fn begin_frame(&mut self, gl: &Context)
pub fn begin_frame(&mut self, gl: &Context)
Begin a new frame. Waits for the oldest frame to complete if necessary.
Sourcepub fn end_frame(&mut self, gl: &Context)
pub fn end_frame(&mut self, gl: &Context)
End the current frame: insert a fence and advance to next slot.
Sourcepub fn register_transient(&mut self, resource_id: u32)
pub fn register_transient(&mut self, resource_id: u32)
Register a transient resource for the current frame.
Sourcepub fn current_frame_number(&self) -> u64
pub fn current_frame_number(&self) -> u64
Current frame number (total frames started).
Sourcepub fn current_slot(&self) -> usize
pub fn current_slot(&self) -> usize
Current slot index in the ring.
Sourcepub fn is_frame_complete(&mut self, gl: &Context, frame_number: u64) -> bool
pub fn is_frame_complete(&mut self, gl: &Context, frame_number: u64) -> bool
Check if a specific frame has completed.
Sourcepub fn average_latency(&self) -> Option<Duration>
pub fn average_latency(&self) -> Option<Duration>
Get the average frame latency (time between begin and GPU completion).
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.