deno
094e4719 - fix(webgpu): own mapped range backing stores (#36257)

Commit
92 days ago
fix(webgpu): own mapped range backing stores (#36257) ## Summary - back mapped WebGPU ranges with V8-owned `ArrayBuffer` storage - copy writable ranges back before unmapping and detach every returned range when unmapping or destroying the buffer - cover multi-range writeback and mapped-range detachment ## Background Writable mapped ranges previously used backend memory directly, while readable ranges were copied without being retained for detachment. This made returned `ArrayBuffer` lifetimes depend on the native mapping and left readable ranges attached after `unmap()`. Keeping JavaScript ranges in owned storage makes their lifetime independent of the backend mapping. Writable data is copied back before the mapping closes, including when callers request multiple non-overlapping ranges. ## Tests - `cargo test -p deno_webgpu` - `cargo build -p deno -p test_server` - `cargo test -p unit_tests --test unit webgpu_test` - `cargo clippy -p deno_webgpu --all-targets -- -D warnings` - `./tools/format.js ext/webgpu/buffer.rs tests/unit/webgpu_test.ts` - `./tools/lint.js tests/unit/webgpu_test.ts`
Author
Parents
Loading