From 29d712f9de99c646bbebd97cbe55ad5d81486612 Mon Sep 17 00:00:00 2001 From: Natasha Lee Date: Mon, 30 Mar 2020 11:37:44 +0000 Subject: [PATCH] D3D12 Immediately release pending commands We want to release pending commands in Device::WaitForIdleForDestruction() so that when we call TickImpl(), we can reset the command allocators. Bug: dawn:269 Change-Id: Ibd8fdd685a4e9ed7cce8176ba097bc67687bcd97 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18101 Reviewed-by: Austin Eng Reviewed-by: Corentin Wallez Commit-Queue: Corentin Wallez --- src/dawn_native/d3d12/DeviceD3D12.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dawn_native/d3d12/DeviceD3D12.cpp b/src/dawn_native/d3d12/DeviceD3D12.cpp index e9fdf874c0..efa383755c 100644 --- a/src/dawn_native/d3d12/DeviceD3D12.cpp +++ b/src/dawn_native/d3d12/DeviceD3D12.cpp @@ -416,6 +416,9 @@ namespace dawn_native { namespace d3d12 { } MaybeError Device::WaitForIdleForDestruction() { + // Immediately forget about all pending commands + mPendingCommands.Release(); + DAWN_TRY(NextSerial()); // Wait for all in-flight commands to finish executing DAWN_TRY(WaitForSerial(mLastSubmittedSerial));