pub struct GpuDiagnosticLog { /* private fields */ }Expand description
The most recent GpuDiagnostics in arrival order, bounded to capacity events of at most
MAX_DIAGNOSTIC_MESSAGE_BYTES each.
Failure reports read it to find the cause of errors that carry none (such as
wgpu::BufferAsyncError). Its memory is fixed because it is read 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, including out-of-memory reports. A device loss is kept.
Sourcepub fn device_lost(&self) -> bool
pub fn device_lost(&self) -> bool
Whether a device loss was ever recorded.
Trait Implementations§
Source§impl Debug for GpuDiagnosticLog
impl Debug for GpuDiagnosticLog
Auto Trait Implementations§
impl !Freeze for GpuDiagnosticLog
impl RefUnwindSafe for GpuDiagnosticLog
impl Send for GpuDiagnosticLog
impl Sync for GpuDiagnosticLog
impl Unpin for GpuDiagnosticLog
impl UnsafeUnpin for GpuDiagnosticLog
impl UnwindSafe for GpuDiagnosticLog
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