Skip to content

Commit 628a25e

Browse files
authored
The fix from #3233 on top of the v0.14 branch (#3241)
1 parent 77b9a99 commit 628a25e

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ Bottom level categories:
4040

4141
## Unreleased
4242

43+
## wgpu-0.14.2 (2022-11-28)
44+
45+
### Bug Fixes
46+
47+
- Fix incorrect offset in `get_mapped_range` by @nical in [#3233](https://github.com/gfx-rs/wgpu/pull/3233)
48+
4349
## wgpu-0.14.1 (2022-11-02)
4450

4551
### Bug Fixes

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wgpu-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wgpu-core"
3-
version = "0.14.0"
3+
version = "0.14.2"
44
authors = ["wgpu developers"]
55
edition = "2021"
66
description = "WebGPU core logic on wgpu-hal"

wgpu-core/src/device/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5654,7 +5654,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
56545654
max: range.end,
56555655
});
56565656
}
5657-
unsafe { Ok((ptr.as_ptr().offset(offset as isize), range_size)) }
5657+
// ptr points to the beginning of the range we mapped in map_async
5658+
// rather thant the beginning of the buffer.
5659+
let relative_offset = (offset - range.start) as isize;
5660+
unsafe { Ok((ptr.as_ptr().offset(relative_offset), range_size)) }
56585661
}
56595662
resource::BufferMapState::Idle | resource::BufferMapState::Waiting(_) => {
56605663
Err(BufferAccessError::NotMapped)

wgpu/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wgpu"
3-
version = "0.14.0"
3+
version = "0.14.2"
44
authors = ["wgpu developers"]
55
edition = "2021"
66
description = "Rusty WebGPU API wrapper"
@@ -89,7 +89,7 @@ vulkan-portability = ["wgc/vulkan-portability"]
8989
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
9090
package = "wgpu-core"
9191
path = "../wgpu-core"
92-
version = "0.14"
92+
version = "0.14.2"
9393
features = ["raw-window-handle"]
9494

9595
[target.'cfg(target_arch = "wasm32")'.dependencies.wgc]

0 commit comments

Comments
 (0)