Struct re_renderer::error_handling::error_tracker::ErrorTracker
source · pub struct ErrorTracker {
pub errors: Mutex<HashMap<ContextError, ErrorEntry>>,
}
Expand description
Keeps track of wgpu errors and de-duplicates messages across frames.
On native & webgl, what accounts for as an error duplicate is a heuristic based on wgpu-core error type.
Used to avoid spamming the user with repeating errors.
crate::RenderContext
maintains a “top level” error tracker for all otherwise unhandled errors.
TODO(#4507): Users should be able to create their own scopes feeding into separate trackers.
Fields§
§errors: Mutex<HashMap<ContextError, ErrorEntry>>
Implementations§
source§impl ErrorTracker
impl ErrorTracker
sourcepub fn on_device_timeline_frame_finished(
&self,
device_timeline_frame_index: u64
)
pub fn on_device_timeline_frame_finished( &self, device_timeline_frame_index: u64 )
Called by the renderer context when the last error scope of a frame has finished.
Error scopes live on the device timeline, which may be arbitrarily delayed compared to the content timeline. See https://www.w3.org/TR/webgpu/#programming-model-timelines. Do not call this with the content pipeline’s frame index!
sourcepub fn handle_error_future(
self: &Arc<Self>,
backend_type: WgpuBackendType,
error_scope_result: impl IntoIterator<Item = impl Future<Output = Option<Error>> + Send + 'static>,
frame_index: u64,
on_last_scope_resolved: impl Fn(&Self, u64) + Send + Sync + 'static
)
pub fn handle_error_future( self: &Arc<Self>, backend_type: WgpuBackendType, error_scope_result: impl IntoIterator<Item = impl Future<Output = Option<Error>> + Send + 'static>, frame_index: u64, on_last_scope_resolved: impl Fn(&Self, u64) + Send + Sync + 'static )
Handles an async error, calling ErrorTracker::handle_error
as needed.
on_last_scope_resolved
is called when the last scope has resolved.
frame_index
should be the currently active frame index which is associated with the scope.
(by the time the scope finishes, the active frame index may have changed)
sourcepub fn handle_error(&self, error: Error, frame_index: u64)
pub fn handle_error(&self, error: Error, frame_index: u64)
Logs a wgpu error to the tracker.
If the error happened already already, it will be deduplicated.
frame_index
should be the frame index associated with the error scope.
Since errors are reported on the device timeline
, not the content timeline
,
this may not be the currently active frame index!
Trait Implementations§
source§impl Default for ErrorTracker
impl Default for ErrorTracker
source§fn default() -> ErrorTracker
fn default() -> ErrorTracker
Auto Trait Implementations§
impl !Freeze for ErrorTracker
impl !RefUnwindSafe for ErrorTracker
impl Send for ErrorTracker
impl Sync for ErrorTracker
impl Unpin for ErrorTracker
impl !UnwindSafe for ErrorTracker
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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