-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved wgpu error handling, no more crashes through wgpu validation errors #4509
Improved wgpu error handling, no more crashes through wgpu validation errors #4509
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phew, that was a lot!
The frame_index_for_uncaptured_errors
is a bit confusing to me - maybe you can make a diagram or something? 😬
…mproved-wgpu-error-handling
originally called |
What
There's a bunch of things that probably should have been separate PRs but by the time I ventured there it got too hard to entangle, so please bear with me and read this detailed list of changes carefully (if you understand this list you've done half the review ;-)):
cfg_aliases
andcfg_if
in various places to make cfg decisions more readableErrorTracker
is now used in all build configurations. Previously, it was only active on debug native buildsRendererContext
does now is to install global error handlers that feed into the "top level"ErrorTracker
. Previously this was done delayed and only for debug+nativeErrorTracker
never panics nowErrorTracker
no longer uses a frame counting heuristic (!!) to discard all errors, but instead relies on precise device timeline frame counters to discard individual errorsContent
(your code)Device
(everything happening on wgpu::Device)Queue
(everything happening on the GPU, represented by wgpu::Queue)Content
andDevice
are mostly in sync on wgpu-core, but NOT on WebGPU in general!ErrorTracker
into its own module and fall back to simple string hashing for WebGPU(the only webgpu enabled build we have today), we don't even depend on wgpu-core!
WgpuErrorScope
utility for safe & fully covering wgpu error scopesnow_or_never
on wgpu-core backend since we know this is safe. On WebGPU we hand off execution to the browser.WgpuErrorScope
in order to catch all errorsThings related, but NOT covered by this PR:
Checklist