Fix dropping Device if not using indirect validation (#6681)

This commit is contained in:
Nathan Adams authored and GitHub committed 2024-12-07 22:17:12 +01:00
1 parent ebdd958d4b
commit 11b51693d3
2 files changed
+4 -4

No files matched your search

+1
View File
@@ -160,6 +160,7 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148]
- Check that begin and end indices are not equal.
- Check that at least one index is specified.
- Reject destroyed buffers in query set resolution. By @ErichDonGubler in [#6579](https://github.com/gfx-rs/wgpu/pull/6579).
- Fix panic when dropping `Device` on some environments. By @Dinnerbone in [#6681](https://github.com/gfx-rs/wgpu/pull/6681).
#### Naga
+3 -4
View File
@@ -154,10 +154,9 @@ impl Drop for Device {
// SAFETY: We are in the Drop impl and we don't use self.fence anymore after this point.
let fence = unsafe { ManuallyDrop::take(&mut self.fence.write()) };
#[cfg(feature = "indirect-validation")]
self.indirect_validation
.take()
.unwrap()
.dispose(self.raw.as_ref());
if let Some(indirect_validation) = self.indirect_validation.take() {
indirect_validation.dispose(self.raw.as_ref());
}
unsafe {
self.raw.destroy_buffer(zero_buffer);
self.raw.destroy_fence(fence);