-
Notifications
You must be signed in to change notification settings - Fork 960
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
Mark the device as lost when hal produces a device lost error #5132
Comments
An possible approach is to handle it outside of wgpu-core, near the code that deals with error scopes since it's a central place where errors are processed. That means all users of wgpu-core (wgpu, wgpu-native and gecko) would have to do it separately. The next question is whether the device lost callback should be invoked right away or next time the device is polled. |
My plan is now to detect device lost errors when converting the hal device error type to the wgpu-core one. It will require a bit of plumbing but has the merit of structurally making sure we can't forget to check. It will mark the device as lost and the device will fire the device lost callback next time it is polled. |
Scratch that, it's way too invasive. |
I'm looking into how to deal with It appears that it's currently not possible to detect these (given the lack of wiring on the |
This is accurate. We need to find a good way to inspect every error, detect when it's a device loss and react accordingly (mark the device as lost so that it skips further calls and invoke the device loss callback. This is not implemented yet unfortunately and a good way to help is to try to implement it. I'm not sure yet what the most practical way to do this is. I lean on the side of having some kind of But someone needs to try and see if it works well. It's somewhat high on my priority list, unfortunately there's a bunch of more pressing issues that will keep me busy in the short/medium term. |
Another solution that was discussed is to do something similar to what I described in my previous comment, but in the backends instead of in wgpu-core. The backends have simpler error types since they don't contain validation, so it might be easier to check there, even if it would involve duplicating the logic. |
We currently do not detect when hal produces a device lost error. In this situation we should call
Global::device_mark_lost
to fire the device lost callback and prevent the device from issuing hal commands again (other than potentially destroying resources).See also #4907 which has a broader scope.
The text was updated successfully, but these errors were encountered: