From aa96b257460a07b30489d104fae08d095a9e3a4e Mon Sep 17 00:00:00 2001 From: Joe Sorensen Date: Mon, 8 Jul 2024 15:25:29 -0600 Subject: [PATCH] `egui-wgpu`: Ensure that `WgpuConfiguration` is `Send + Sync` (#4803) As far as I can tell, there's no reason that this shouldn't be the case --- crates/egui-wgpu/src/lib.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/egui-wgpu/src/lib.rs b/crates/egui-wgpu/src/lib.rs index d03e4e046f66..acc79ad00a3a 100644 --- a/crates/egui-wgpu/src/lib.rs +++ b/crates/egui-wgpu/src/lib.rs @@ -230,7 +230,8 @@ pub struct WgpuConfiguration { pub supported_backends: wgpu::Backends, /// Configuration passed on device request, given an adapter - pub device_descriptor: Arc wgpu::DeviceDescriptor<'static>>, + pub device_descriptor: + Arc wgpu::DeviceDescriptor<'static> + Send + Sync>, /// Present mode used for the primary surface. pub present_mode: wgpu::PresentMode, @@ -248,7 +249,13 @@ pub struct WgpuConfiguration { pub power_preference: wgpu::PowerPreference, /// Callback for surface errors. - pub on_surface_error: Arc SurfaceErrorAction>, + pub on_surface_error: Arc SurfaceErrorAction + Send + Sync>, +} + +#[test] +fn wgpu_config_impl_send_sync() { + fn assert_send_sync() {} + assert_send_sync::(); } impl std::fmt::Debug for WgpuConfiguration {