pub struct FenceSync { /* private fields */ }Expand description
A GPU fence for synchronizing compute and render work.
Insert a fence after issuing GPU commands; then poll or wait for it to determine when the GPU has finished processing those commands.
Implementations§
Source§impl FenceSync
impl FenceSync
Sourcepub fn poll(&mut self, gl: &Context) -> FenceStatus
pub fn poll(&mut self, gl: &Context) -> FenceStatus
Poll the fence without blocking. Returns current status.
Sourcepub fn wait(&mut self, gl: &Context, timeout: Duration) -> FenceStatus
pub fn wait(&mut self, gl: &Context, timeout: Duration) -> FenceStatus
Wait for the fence with a timeout. Returns status after wait.
Sourcepub fn wait_forever(&mut self, gl: &Context) -> FenceStatus
pub fn wait_forever(&mut self, gl: &Context) -> FenceStatus
Block until the fence is signaled (infinite wait).
Sourcepub fn status(&self) -> FenceStatus
pub fn status(&self) -> FenceStatus
Current status (may be stale — call poll() to refresh).
Sourcepub fn is_signaled(&self) -> bool
pub fn is_signaled(&self) -> bool
Whether the fence has been signaled.
Sourcepub fn elapsed_since_insert(&self) -> Option<Duration>
pub fn elapsed_since_insert(&self) -> Option<Duration>
How long ago the fence was inserted (wall-clock, not GPU time).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FenceSync
impl RefUnwindSafe for FenceSync
impl !Send for FenceSync
impl !Sync for FenceSync
impl Unpin for FenceSync
impl UnsafeUnpin for FenceSync
impl UnwindSafe for FenceSync
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.