You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It should be possible to catch errors in a manner which is compatible with multi-threaded use of a wgpu::Device. The current push_error_scope() and pop_error_scope() use a scope stack global to the Device and thus would require a mutex to be used correctly from a program where multiple threads access the Device or Queue.
My own application for this is catching shader compilation errors to allow shader reloading during development without aborting the program on any error.
Describe the solution you'd like #3767 already says that
This actually wasn't really previously defined - webgpu.h we decided they're going to be thread local. We need to redefine the api in wgpu to use a thread local.
which seems like a fine solution, but that's labeled as a documentation issue, so I'm filing this issue to make sure the functional change isn't overlooked.
It would also be good if the Rust interface to these error scopes was a "RAII" guard type rather than a pair of push and pop, to ensure correct cleanup on unwinding and to make push-without-pop/pop-without-push mistakes unlikely.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
It should be possible to catch errors in a manner which is compatible with multi-threaded use of a
wgpu::Device
. The currentpush_error_scope()
andpop_error_scope()
use a scope stack global to theDevice
and thus would require a mutex to be used correctly from a program where multiple threads access theDevice
orQueue
.My own application for this is catching shader compilation errors to allow shader reloading during development without aborting the program on any error.
Describe the solution you'd like
#3767 already says that
which seems like a fine solution, but that's labeled as a documentation issue, so I'm filing this issue to make sure the functional change isn't overlooked.
It would also be good if the Rust interface to these error scopes was a "RAII" guard type rather than a pair of push and pop, to ensure correct cleanup on unwinding and to make push-without-pop/pop-without-push mistakes unlikely.
The text was updated successfully, but these errors were encountered: