pub struct GpuDiagnosticLog { /* private fields */ }Expand description
The most recent GpuDiagnostics, in arrival order, in fixed memory:
at most capacity events, each text at most
MAX_DIAGNOSTIC_MESSAGE_BYTES and an ellipsis.
A failure report reads it to connect an error a call returned (a readback
that failed to map carries no cause: wgpu::BufferAsyncError is a unit)
with what the device reported around it. Its size never grows
with the events, because it is consulted exactly when memory may be short.
Implementations§
Source§impl GpuDiagnosticLog
impl GpuDiagnosticLog
Sourcepub const DEFAULT_CAPACITY: usize = 16
pub const DEFAULT_CAPACITY: usize = 16
Default number of events a log keeps.
Sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
An empty log keeping at most capacity events (at least one).
Sourcepub fn push(&self, diagnostic: GpuDiagnostic)
pub fn push(&self, diagnostic: GpuDiagnostic)
Records diagnostic, pushing out the oldest event when full.
Sourcepub fn snapshot(&self) -> GpuDiagnosticSnapshot
pub fn snapshot(&self) -> GpuDiagnosticSnapshot
A copy of what the log holds now.
Sourcepub fn clear(&self)
pub fn clear(&self)
Forgets the events, so the next snapshot covers only what follows, out-of-memory reports included. A device loss is kept: a lost device stays lost.
Sourcepub fn device_lost(&self) -> bool
pub fn device_lost(&self) -> bool
Whether a device loss was ever recorded.