Device: Mark all commands as completed on device loss

Previously device loss would produce an assert when shutting down where
the frontend though not all commands where finished.

Bug: chromium:1242195
Change-Id: I90fe626b6930859b3fd98b660882fb11b6a9ff8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62542
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
Corentin Wallez 2021-08-26 09:25:15 +00:00 committed by Dawn LUCI CQ
parent 2aee6eef7f
commit 21940df81b
1 changed files with 2 additions and 1 deletions

View File

@ -265,7 +265,8 @@ namespace dawn_native {
void DeviceBase::HandleError(InternalErrorType type, const char* message) {
if (type == InternalErrorType::DeviceLost) {
// A real device lost happened. Set the state to disconnected as the device cannot be
// used.
// used. Also tags all commands as completed since the device stopped running.
AssumeCommandsComplete();
mState = State::Disconnected;
} else if (type == InternalErrorType::Internal) {
// If we receive an internal error, assume the backend can't recover and proceed with