wgpu
wgpu copied to clipboard
Create Common Interface for Validation Warnings
Is your feature request related to a problem? Please describe.
We want to validate that all tests pass without any validation issues. The best way to do this would be to communicate validation issues to the tests via a common callback. This needs to be built into wgpu because there are 4 different backends we need to listen to validation errors from and they all need different code to listen to them.
Describe the solution you'd like
An interface like:
impl Device {
pub fn register_validation_callback(&self, function: Box<dyn Fn(...));
}
This would allow the outside to listen to validation. We can easily paper over the native vs non-native thing because we can just ignore the callback on web or in release.
Describe alternatives you've considered
Listening to stdout. This gets very nasty once parallel testing is involved and is basically abusing side-effects in a way I'm not really comfortable with.
Additional context
Related: #1383
That sounds pretty interesting! Here are two edits:
- We'd also need to pass the priority filter (error/warning/info). We can use
log::Levelfor this - We'd probably want to pass this callback in the
InstanceDescriptiorinstead of a method on the device.
Solved with new hal
Closed the wrong issue
Solved with validation canary.