pub struct GpuFence {
pub id: u64,
pub status: FenceStatus,
pub label: Option<String>,
/* private fields */
}Expand description
A logical GPU fence (CPU-side descriptor).
In real GPU code this would wrap a wgpu::QuerySet or a Vulkan VkFence;
here it tracks status in CPU memory.
Fields§
§id: u64Unique identifier.
status: FenceStatusCurrent status.
label: Option<String>Optional debug label.
Implementations§
Source§impl GpuFence
impl GpuFence
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Attaches a debug label.
Sourcepub fn signal(&mut self)
pub fn signal(&mut self)
Signals the fence, marking GPU work as submitted.
In a real implementation this would record the fence into a command buffer; here we just record the signal time.
Sourcepub fn is_signalled(&self) -> bool
pub fn is_signalled(&self) -> bool
Returns true when the fence has been signalled.
Sourcepub fn wait_timeout_ms(&mut self, timeout_ms: u64) -> bool
pub fn wait_timeout_ms(&mut self, timeout_ms: u64) -> bool
Blocks (simulated) until the fence is signalled or timeout_ms
milliseconds elapse.
Returns true if the fence was already signalled (no real blocking in
this CPU-only simulation).
Sourcepub fn simulated_latency(&self) -> Duration
pub fn simulated_latency(&self) -> Duration
Returns the simulated latency of this fence.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuFence
impl RefUnwindSafe for GpuFence
impl Send for GpuFence
impl Sync for GpuFence
impl Unpin for GpuFence
impl UnsafeUnpin for GpuFence
impl UnwindSafe for GpuFence
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