* Have `prepare_staging_buffer` take a raw hal Device.
This helps the borrow checker understand that we can borrow
`pending_writes`'s encoder and the raw Device at the same time.
* Always free staging buffers.
We must ensure that the staging buffer is not leaked when an error
occurs, so allocate it as late as possible, and free it explicitly when
those fallible operations we can't move it past go awry.
Fixes#2959.
* Some tests for texture and buffer copies.
* Add CHANGELOG.md entry.
Since `wgpu-core`'s public functions are supposed to validate their
parameters, the internal `track` module skips many of Rust's usual
run-time checks in release builds. However, some `wgpu-core` users are
happy to pay the performance cost in exchange for more safety. The
`"strict_asserts"` feature causes `wgpu_core` to perform the same
checks in release builds as it does in debug builds.
* Validate that map_async's range is not negative.
map_async already checks that the range's end is within the bounds of the buffer, so this also ensures the range start is within bounds.
* Add an entry in the changelog.
* Fix opening renderdoc lib
Renderdoc needs to not be opened by us, but instead open the existing copy.
Unfortunately this requires OS specific flags for opening, plus `libloading`
doesn't have full API coverage currently.
* Added changelog entry for #2930
* Hide RTLD_NOLOAD behind a cfg for unix
Co-authored-by: ABuffSeagull <reecevanatta@hey.com>
* StagingBelt: check for free chunks in the `receiver` as well as `free_chunks`.
Previously, chunks would only be taken from the GPU callback receiver
and put on `free_chunks` during `finish()`. So, there might be chunks
that are actually available for use but wouldn't be used.
Now, we consult the receiver whenever we're about to consult the
`free_chunks`, so the reuse of chunks will be as good as possible (given
the application's uses of operations that trigger `map_async` callbacks).
* Changelog entry.
* Record that the buffer is mapped when its size is zero.
* Avoid internally trying to map a zero-sized buffer if mapped_at_creation is true.
* Add an entry in the changelog.
The versions of wasm-bindgen-cli run by `.github/workflows/publish.yml` must
exactly match the version of `wasm-bindgen` used by `wgpu`. At the moment,
`wgpu/Cargo.toml` specifies `0.2.81`, and our `Cargo.lock` agrees, so
that is what `publish.yml` should mention.
The wgpu web backend uses `()` as `Context::SubmissionIndex`, which is
fine --- WebGPU provides no way to identify individual queue
submissions --- except that Clippy is concerned about us passing
around `()` in the front end as if it were a real value. Instead,
define a new zero-size `wgpu::backend::web::SubmissionIndex` type for
this use.
* Ensure the BufferMapAsyncCallback is always called.
This solves two issues on the Gecko side:
- The callback cleans up after itself (the user data is deleted at the end of the callback), so dropping the callback without calling it is a memory leak. I can't think of a better way to implement this on the C++ side since there can be any number of callback at any time living for an unspecified amount of time.
- This makes it easier to implement the error reporting of the WebGPU spec.
* Update the changelog.