497: Catch swapchain output being dropped too early r=kvark a=kvark

Prevents a common case where the swapchain frame is dropped before the submission. This is not comprehensive yet, but it should be helpful.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
bors[bot] 2020-02-19 03:58:24 +00:00 committed by GitHub
commit 4f937c04e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1369,6 +1369,9 @@ impl<F: AllIdentityFilter + IdentityFilter<id::CommandBufferId>> Global<F> {
if let Some((sc_id, fbo)) = comb.used_swap_chain.take() { if let Some((sc_id, fbo)) = comb.used_swap_chain.take() {
let sc = &mut swap_chain_guard[sc_id.value]; 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() { if sc.acquired_framebuffers.is_empty() {
signal_swapchain_semaphores.push(sc_id.value); signal_swapchain_semaphores.push(sc_id.value);
} }