Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The fix from #3233 on top of the v0.14 branch #3241

Merged
merged 2 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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