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>
diff --git a/src/dawn_native/Device.cpp b/src/dawn_native/Device.cpp
index c30181a..2c70721 100644
--- a/src/dawn_native/Device.cpp
+++ b/src/dawn_native/Device.cpp
@@ -265,7 +265,8 @@
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