wgpu/tests
Nicolas Silva 1dc5347b14
Better handle destroying textures and buffers (#4657)
* Better handle destroying textures and buffers

Before this commit, explicitly destroying a texture or a buffer (without dropping it)
schedules the asynchronous destruction of its raw resources but does not actually mark
it as destroyed. This can cause some incorrect behavior, for example mapping a buffer
after destroying it does not cause a validation error (and later panics due to the
map callback being dropped without being called).

This Commit adds `Storage::take_and_mark_destroyed` for use in `destroy` methods.
Since it puts the resource in the error state, other methods properly catch that
the resource is no longer usable when attempting to access it and raise validation
errors.

There are other resource types that require similar treatment and will be addressed
in followup work.

* Add a changelog entry
2023-11-09 15:48:06 +01:00
..
src Fix GL Push Constant Layout (#4607) 2023-11-06 07:58:26 -05:00
tests Better handle destroying textures and buffers (#4657) 2023-11-09 15:48:06 +01:00
Cargo.toml Extra Profiling Scopes (#4610) 2023-10-30 03:58:32 +00:00