diff --git a/CHANGELOG.md b/CHANGELOG.md index 90f747f79..00d53de0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,7 +59,7 @@ This feature allowed you to call `global_id` on any wgpu opaque handle to get a #### General - Added `DownlevelFlags::VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW` to know if `@builtin(vertex_index)` and `@builtin(instance_index)` will respect the `first_vertex` / `first_instance` in indirect calls. If this is not present, both will always start counting from 0. Currently enabled on all backends except DX12. By @cwfitzgerald in [#4722](https://github.com/gfx-rs/wgpu/pull/4722) -- No longer validate surfaces against their allowed extent range on configure. This caused warnings that were almost impossible to avoid. As before, the resulting behavior depends on the compositor. By @wumpf in [#????](https://github.com/gfx-rs/wgpu/pull/????) +- No longer validate surfaces against their allowed extent range on configure. This caused warnings that were almost impossible to avoid. As before, the resulting behavior depends on the compositor. By @wumpf in [#4796](https://github.com/gfx-rs/wgpu/pull/4796) - Added support for the float32-filterable feature. By @almarklein in [#4759](https://github.com/gfx-rs/wgpu/pull/4759) #### OpenGL @@ -157,6 +157,10 @@ Passing an owned value `window` to `Surface` will return a `Surface<'static>`. S ### Bug Fixes +#### General + +- `BufferMappedRange` trait is now `WasmNotSendSync`, i.e. it is `Send`/`Sync` if not on wasm or `fragile-send-sync-non-atomic-wasm` is enabled. By @wumpf in [#4818](https://github.com/gfx-rs/wgpu/pull/4818) + #### Vulkan - Use `VK_EXT_robustness2` only when not using an outdated intel iGPU driver. By @TheoDulka in [#4602](https://github.com/gfx-rs/wgpu/pull/4602). diff --git a/wgpu/src/backend/web.rs b/wgpu/src/backend/web.rs index 4b6e527ab..82b31c6f6 100644 --- a/wgpu/src/backend/web.rs +++ b/wgpu/src/backend/web.rs @@ -92,6 +92,16 @@ unsafe impl Send for Context {} not(target_feature = "atomics") ))] unsafe impl Sync for Context {} +#[cfg(all( + feature = "fragile-send-sync-non-atomic-wasm", + not(target_feature = "atomics") +))] +unsafe impl Send for BufferMappedRange {} +#[cfg(all( + feature = "fragile-send-sync-non-atomic-wasm", + not(target_feature = "atomics") +))] +unsafe impl Sync for BufferMappedRange {} impl fmt::Debug for Context { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/wgpu/src/context.rs b/wgpu/src/context.rs index f81867a2e..46ba86cdb 100644 --- a/wgpu/src/context.rs +++ b/wgpu/src/context.rs @@ -4089,7 +4089,7 @@ where } } -pub trait QueueWriteBuffer: WasmNotSendSync { +pub trait QueueWriteBuffer: WasmNotSendSync + Debug { fn slice(&self) -> &[u8]; fn slice_mut(&mut self) -> &mut [u8]; @@ -4097,7 +4097,7 @@ pub trait QueueWriteBuffer: WasmNotSendSync { fn as_any(&self) -> &dyn Any; } -pub trait BufferMappedRange: Debug { +pub trait BufferMappedRange: WasmNotSendSync + Debug { fn slice(&self) -> &[u8]; fn slice_mut(&mut self) -> &mut [u8]; }