pub struct Fence { /* private fields */ }Expand description
Fence for CPU-GPU synchronization
A fence allows the CPU to wait for GPU operations to complete.
Implementations§
Source§impl Fence
impl Fence
Sourcepub fn signal(&self)
pub fn signal(&self)
Signal the fence
This should be called after submitting GPU commands that you want to wait for.
Sourcepub fn wait(&self)
pub fn wait(&self)
Wait for the fence to be signaled
This will block the current thread until the GPU has completed the operations that were submitted before the fence was signaled.
Sourcepub fn wait_timeout(&self, timeout: Duration) -> bool
pub fn wait_timeout(&self, timeout: Duration) -> bool
Sourcepub fn is_signaled(&self) -> bool
pub fn is_signaled(&self) -> bool
Check if the fence is signaled without blocking
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Fence
impl !UnwindSafe for Fence
impl Freeze for Fence
impl Send for Fence
impl Sync for Fence
impl Unpin for Fence
impl UnsafeUnpin for Fence
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more