d3d: append device lost message for all errors

I found ID3D11DeviceContext4::Signal() may returns
<Unknown HRESULT> (0x88760870) or E_INVALIDARG. I
suspect it could be related to device loss as well,
so check removed device reason for all errors.

Bug: chromium:1489643
Change-Id: I09ee9dbe05803a025bd830d71ee10163b4469788
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/156362
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
diff --git a/src/dawn/native/Device.cpp b/src/dawn/native/Device.cpp
index f700c5b..540e2aa 100644
--- a/src/dawn/native/Device.cpp
+++ b/src/dawn/native/Device.cpp
@@ -534,13 +534,19 @@
                              InternalErrorType additionalAllowedErrors,
                              WGPUDeviceLostReason lost_reason) {
     AppendDebugLayerMessages(error.get());
+
+    InternalErrorType type = error->GetType();
+    if (type != InternalErrorType::Validation) {
+        // D3D device can provide additional device removed reason. We would
+        // like to query and log the the device removed reason if the error is
+        // not validation error.
+        AppendDeviceLostMessage(error.get());
+    }
+
     InternalErrorType allowedErrors =
         InternalErrorType::Validation | InternalErrorType::DeviceLost | additionalAllowedErrors;
-    InternalErrorType type = error->GetType();
-    if (type == InternalErrorType::DeviceLost) {
-        // D3D device can provide additional device removed reason.
-        AppendDeviceLostMessage(error.get());
 
+    if (type == InternalErrorType::DeviceLost) {
         mState = State::Disconnected;
 
         // If the ErrorInjector is enabled, then the device loss might be fake and the device