-
Notifications
You must be signed in to change notification settings - Fork 612
Improved wgpu error handling, no more crashes through wgpu validation errors #4509
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
Conversation
emilk
left a comment
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_aliasesandcfg_ifin various places to make cfg decisions more readableErrorTrackeris now used in all build configurations. Previously, it was only active on debug native buildsRendererContextdoes now is to install global error handlers that feed into the "top level"ErrorTracker. Previously this was done delayed and only for debug+nativeErrorTrackernever panics nowErrorTrackerno 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)ContentandDeviceare mostly in sync on wgpu-core, but NOT on WebGPU in general!ErrorTrackerinto 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!
WgpuErrorScopeutility for safe & fully covering wgpu error scopesnow_or_neveron wgpu-core backend since we know this is safe. On WebGPU we hand off execution to the browser.WgpuErrorScopein order to catch all errorsThings related, but NOT covered by this PR:
Checklist