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 <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Natasha Lee 2020-03-30 11:37:44 +00:00 committed by Commit Bot service account
parent 81431f5034
commit 29d712f9de
1 changed files with 3 additions and 0 deletions

View File

@ -416,6 +416,9 @@ namespace dawn_native { namespace d3d12 {
} }
MaybeError Device::WaitForIdleForDestruction() { MaybeError Device::WaitForIdleForDestruction() {
// Immediately forget about all pending commands
mPendingCommands.Release();
DAWN_TRY(NextSerial()); DAWN_TRY(NextSerial());
// Wait for all in-flight commands to finish executing // Wait for all in-flight commands to finish executing
DAWN_TRY(WaitForSerial(mLastSubmittedSerial)); DAWN_TRY(WaitForSerial(mLastSubmittedSerial));