Skip to content

Commit 5526e4e

Browse files
committed
[core] Implement WebGPUError for WaitIdleError.
1 parent e114d2f commit 5526e4e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

wgpu-core/src/device/life.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use alloc::{sync::Arc, vec::Vec};
22

33
use smallvec::SmallVec;
44
use thiserror::Error;
5+
use wgt::error::{ErrorType, WebGpuError};
56

67
use crate::{
78
device::{
@@ -146,6 +147,17 @@ impl WaitIdleError {
146147
}
147148
}
148149

150+
impl WebGpuError for WaitIdleError {
151+
fn webgpu_error_type(&self) -> ErrorType {
152+
match self {
153+
WaitIdleError::Device(device_error) => device_error.webgpu_error_type(),
154+
WaitIdleError::WrongSubmissionIndex(_, _) | WaitIdleError::Timeout => {
155+
ErrorType::Internal
156+
}
157+
}
158+
}
159+
}
160+
149161
/// Resource tracking for a device.
150162
///
151163
/// ## Host mapping buffers

0 commit comments

Comments
 (0)