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

This commit is contained in:
Nicolas Silva 2022-11-30 22:43:55 +01:00 committed by GitHub
parent 77b9a99cf4
commit 628a25ef30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 8 deletions

View File

@ -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

8
Cargo.lock generated
View File

@ -2200,7 +2200,7 @@ dependencies = [
[[package]]
name = "wgpu"
version = "0.14.0"
version = "0.14.2"
dependencies = [
"arrayvec 0.7.2",
"async-executor",
@ -2218,7 +2218,7 @@ dependencies = [
"nanorand",
"noise",
"obj",
"parking_lot 0.12.1",
"parking_lot 0.11.2",
"png",
"pollster",
"raw-window-handle 0.5.0",
@ -2236,7 +2236,7 @@ dependencies = [
[[package]]
name = "wgpu-core"
version = "0.14.0"
version = "0.14.2"
dependencies = [
"arrayvec 0.7.2",
"bit-vec",
@ -2246,7 +2246,7 @@ dependencies = [
"fxhash",
"log",
"naga",
"parking_lot 0.12.1",
"parking_lot 0.11.2",
"profiling",
"raw-window-handle 0.5.0",
"ron",

View File

@ -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"

View File

@ -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)

View File

@ -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"
@ -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]