Skip to content

Commit

Permalink
The fix from #3233 on top of the v0.14 branch (#3241)
Browse files Browse the repository at this point in the history
  • Loading branch information
nical authored Nov 30, 2022
1 parent 77b9a99 commit 628a25e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ Bottom level categories:

## Unreleased

## wgpu-0.14.2 (2022-11-28)

### Bug Fixes

- Fix incorrect offset in `get_mapped_range` by @nical in [#3233](https://github.com/gfx-rs/wgpu/pull/3233)

## wgpu-0.14.1 (2022-11-02)

### Bug Fixes
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wgpu-core"
version = "0.14.0"
version = "0.14.2"
authors = ["wgpu developers"]
edition = "2021"
description = "WebGPU core logic on wgpu-hal"
Expand Down
5 changes: 4 additions & 1 deletion wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5654,7 +5654,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
max: range.end,
});
}
unsafe { Ok((ptr.as_ptr().offset(offset as isize), range_size)) }
// ptr points to the beginning of the range we mapped in map_async
// rather thant the beginning of the buffer.
let relative_offset = (offset - range.start) as isize;
unsafe { Ok((ptr.as_ptr().offset(relative_offset), range_size)) }
}
resource::BufferMapState::Idle | resource::BufferMapState::Waiting(_) => {
Err(BufferAccessError::NotMapped)
Expand Down
4 changes: 2 additions & 2 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wgpu"
version = "0.14.0"
version = "0.14.2"
authors = ["wgpu developers"]
edition = "2021"
description = "Rusty WebGPU API wrapper"
Expand Down Expand Up @@ -89,7 +89,7 @@ vulkan-portability = ["wgc/vulkan-portability"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
package = "wgpu-core"
path = "../wgpu-core"
version = "0.14"
version = "0.14.2"
features = ["raw-window-handle"]

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

0 comments on commit 628a25e

Please sign in to comment.