diff --git a/CHANGELOG.md b/CHANGELOG.md index 64973330b..1c0a30a74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/wgpu/src/api/device.rs b/wgpu/src/api/device.rs index 401431bcb..8e0e372dd 100644 --- a/wgpu/src/api/device.rs +++ b/wgpu/src/api/device.rs @@ -714,9 +714,11 @@ impl From for RequestDeviceError { } } -/// Type for the callback of uncaptured error handler -pub trait UncapturedErrorHandler: Fn(Error) + Send + 'static {} -impl 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 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)]