From 023ce7f6c850998fe41f5a3f06f8aaf6d8fbbcff Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Tue, 18 Feb 2020 22:55:54 -0500 Subject: [PATCH] Catch swapchain output being dropped too early --- wgpu-core/src/device/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index ec88db2b2..a86f26546 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -1369,6 +1369,9 @@ impl> Global { if let Some((sc_id, fbo)) = comb.used_swap_chain.take() { let sc = &mut swap_chain_guard[sc_id.value]; + assert!(sc.acquired_view_id.is_some(), + "SwapChainOutput for {:?} was dropped before the respective command buffer {:?} got submitted!", + sc_id.value, cmb_id); if sc.acquired_framebuffers.is_empty() { signal_swapchain_semaphores.push(sc_id.value); }