summaryrefslogtreecommitdiffstats
path: root/third_party/rust/wgpu-hal/src/vulkan/command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/wgpu-hal/src/vulkan/command.rs')
-rw-r--r--third_party/rust/wgpu-hal/src/vulkan/command.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/third_party/rust/wgpu-hal/src/vulkan/command.rs b/third_party/rust/wgpu-hal/src/vulkan/command.rs
index 43a2471954..ceb44dfbe6 100644
--- a/third_party/rust/wgpu-hal/src/vulkan/command.rs
+++ b/third_party/rust/wgpu-hal/src/vulkan/command.rs
@@ -104,6 +104,11 @@ impl crate::CommandEncoder for super::CommandEncoder {
}
unsafe fn discard_encoding(&mut self) {
+ // Safe use requires this is not called in the "closed" state, so the buffer
+ // shouldn't be null. Assert this to make sure we're not pushing null
+ // buffers to the discard pile.
+ assert_ne!(self.active, vk::CommandBuffer::null());
+
self.discarded.push(self.active);
self.active = vk::CommandBuffer::null();
}