Fix ResourceMemoryAllocation null dereference

Moves last TickImpl call during ShutDown to only be called if the
device was fully created.

Bug: dawn:400, chromium:1093639
Change-Id: I25437e3b33d0fc57f21e82c63bfb0fd4d9384175
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23123
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Natasha Lee 2020-06-12 08:13:41 +00:00 committed by Commit Bot service account
parent 5fafb49c7b
commit 82027bd8ac
1 changed files with 3 additions and 3 deletions

View File

@ -152,6 +152,9 @@ namespace dawn_native {
mErrorScopeTracker->Tick(GetCompletedCommandSerial());
mFenceSignalTracker->Tick(GetCompletedCommandSerial());
mMapRequestTracker->Tick(GetCompletedCommandSerial());
// call TickImpl once last time to clean up resources
// assert the errors are device loss so we can continue with destruction
AssertAndIgnoreDeviceLossError(TickImpl());
}
// At this point GPU operations are always finished, so we are in the disconnected state.
@ -166,9 +169,6 @@ namespace dawn_native {
mDynamicUploader = nullptr;
mMapRequestTracker = nullptr;
// call TickImpl once last time to clean up resources
// assert the errors are device loss so we can continue with destruction
AssertAndIgnoreDeviceLossError(TickImpl());
AssumeCommandsComplete();
// Tell the backend that it can free all the objects now that the GPU timeline is empty.
ShutDownImpl();