mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Add Sync bound to uncaptured error handler.
It makes sense for a function to be `FnMut + Send`, or `Fn + Send + Sync`, but not `Fn + Send` because that is overly restrictive for the caller and the callee.
This commit is contained in:
parent
486c151772
commit
2e8a600e35
@ -72,6 +72,8 @@ By @Vecvec in [#7913](https://github.com/gfx-rs/wgpu/pull/7913).
|
||||
- Copies of depth/stencil formats must be 4B aligned.
|
||||
- The offset for `set_vertex_buffer` and `set_index_buffer` must be 4B aligned. By @andyleiserson in [#7929](https://github.com/gfx-rs/wgpu/pull/7929).
|
||||
- The offset and size of bindings are validated as fitting within the underlying buffer in more cases. By @andyleiserson in [#7911](https://github.com/gfx-rs/wgpu/pull/7911).
|
||||
- The function you pass to `Device::on_uncaptured_error()` must now implement `Sync` in addition to `Send`.
|
||||
By @kpreid in [#8011](https://github.com/gfx-rs/wgpu/pull/8011).
|
||||
|
||||
#### Naga
|
||||
|
||||
|
||||
@ -714,9 +714,11 @@ impl From<wgc::instance::RequestDeviceError> for RequestDeviceError {
|
||||
}
|
||||
}
|
||||
|
||||
/// Type for the callback of uncaptured error handler
|
||||
pub trait UncapturedErrorHandler: Fn(Error) + Send + 'static {}
|
||||
impl<T> UncapturedErrorHandler for T where T: Fn(Error) + Send + 'static {}
|
||||
/// The callback of [`Device::on_uncaptured_error()`].
|
||||
///
|
||||
/// It must be a function with this signature.
|
||||
pub trait UncapturedErrorHandler: Fn(Error) + Send + Sync + 'static {}
|
||||
impl<T> UncapturedErrorHandler for T where T: Fn(Error) + Send + Sync + 'static {}
|
||||
|
||||
/// Kinds of [`Error`]s a [`Device::push_error_scope()`] may be configured to catch.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user