ShutDownBase, only tick frontend facilities if they have been created

Bug: chromium:1068886
Bug: chromium:1068887
Change-Id: Ifbec86d806a9e03a7cf029824349a6f94b9fe63c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19290
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-04-15 10:07:25 +00:00 committed by Commit Bot service account
parent cd586a92e8
commit e3f44e3cd6
1 changed files with 13 additions and 8 deletions

View File

@ -111,7 +111,6 @@ namespace dawn_native {
switch (mState) {
case State::BeingCreated:
// The GPU timeline was never started so we don't have to wait.
mState = State::Disconnected;
break;
case State::Alive:
@ -119,7 +118,6 @@ namespace dawn_native {
// complete before proceeding with destruction.
// Assert that errors are device loss so that we can continue with destruction
AssertAndIgnoreDeviceLossError(WaitForIdleForDestruction());
mState = State::Disconnected;
break;
case State::BeingDisconnected:
@ -133,13 +131,20 @@ namespace dawn_native {
break;
}
// The GPU timeline is finished so all services can be freed immediately. They need to be
// freed before ShutDownImpl() because they might relinquish resources that will be freed by
// backends in the ShutDownImpl() call.
// Still tick the ones that might have pending callbacks.
mErrorScopeTracker->Tick(GetCompletedCommandSerial());
// Skip handling device facilities if they haven't even been created (or failed doing so)
if (mState != State::BeingCreated) {
// The GPU timeline is finished so all services can be freed immediately. They need to
// be freed before ShutDownImpl() because they might relinquish resources that will be
// freed by backends in the ShutDownImpl() call. Still tick the ones that might have
// pending callbacks.
mErrorScopeTracker->Tick(GetCompletedCommandSerial());
mFenceSignalTracker->Tick(GetCompletedCommandSerial());
}
// At this point GPU operations are always finished, so we are in the disconnected state.
mState = State::Disconnected;
mErrorScopeTracker = nullptr;
mFenceSignalTracker->Tick(GetCompletedCommandSerial());
mFenceSignalTracker = nullptr;
mDynamicUploader = nullptr;