* 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.
* 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.
1563: Fix stray header in changelog r=cwfitzgerald a=HalfVoxel
It's definitely released by now. I'm guessing it was part of 0.8.1.
Co-authored-by: Aron Granberg <aron.granberg@gmail.com>
1511: Added storage texture array support. r=kvark a=ElectronicRU
**Description**
Arrays of storage images (*f*image*n*D in GLSL parlance) should now be supported.
I also took the liberty to refactor texture format checking a bit,
and tighten up sampled texture support detection for Metal as well.
**Testing**
Not completely sure what's the proper testing approach here, open to suggestions.
Co-authored-by: Alex S <alex0player@gmail.com>
* humble beginnings
* Current progress
* More precise NonZeroU32 change
* Fix typo
* Changelog enough to get my game to compile again
* Fix type change line