Add IsDeviceLost interface.
Expose IsDeviceLost interface to check whether GPU device is lost on
Chromium GPU process.
Change-Id: Icaa27844be6d28fecc53aaf605b150b4a5946d01
Bug:370694819
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/246134
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Shaobo Yan <shaoboyan@microsoft.com>
Commit-Queue: Zhuang Xu <zhuangxu@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/include/dawn/native/DawnNative.h b/include/dawn/native/DawnNative.h
index 9866248..63bac55 100644
--- a/include/dawn/native/DawnNative.h
+++ b/include/dawn/native/DawnNative.h
@@ -354,6 +354,8 @@
// caches, etc.
DAWN_NATIVE_EXPORT void PerformIdleTasks(const wgpu::Device& device);
+DAWN_NATIVE_EXPORT bool IsDeviceLost(WGPUDevice device);
+
} // namespace dawn::native
#endif // INCLUDE_DAWN_NATIVE_DAWNNATIVE_H_
diff --git a/src/dawn/native/DawnNative.cpp b/src/dawn/native/DawnNative.cpp
index 27dbec0..27976ea 100644
--- a/src/dawn/native/DawnNative.cpp
+++ b/src/dawn/native/DawnNative.cpp
@@ -297,4 +297,8 @@
deviceBase->PerformIdleTasks();
}
+bool IsDeviceLost(WGPUDevice device) {
+ return FromAPI(device)->IsLost();
+}
+
} // namespace dawn::native