File tree Expand file tree Collapse file tree 5 files changed +5
-13
lines changed Expand file tree Collapse file tree 5 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ impl GPUError {
188
188
fn from_webgpu ( e : impl WebGpuError ) -> Self {
189
189
match e. webgpu_error_type ( ) {
190
190
ErrorType :: Internal => GPUError :: Internal ,
191
- ErrorType :: DeviceLost { reason } => GPUError :: Lost ( reason . into ( ) ) ,
191
+ ErrorType :: DeviceLost => GPUError :: Lost ( GPUDeviceLostReason :: Unknown ) , // TODO: this variant should be ignored, register the lost callback instead.
192
192
ErrorType :: OutOfMemory => GPUError :: OutOfMemory ,
193
193
ErrorType :: Validation => GPUError :: Validation ( fmt_err ( & e) ) ,
194
194
}
Original file line number Diff line number Diff line change @@ -347,9 +347,7 @@ impl WebGpuError for DeviceError {
347
347
match self {
348
348
DeviceError :: DeviceMismatch ( e) => e. webgpu_error_type ( ) ,
349
349
Self :: ResourceCreationFailed => ErrorType :: OutOfMemory ,
350
- Self :: Lost => ErrorType :: DeviceLost {
351
- reason : DeviceLostReason :: Unknown ,
352
- } ,
350
+ Self :: Lost => ErrorType :: DeviceLost ,
353
351
Self :: OutOfMemory => ErrorType :: OutOfMemory ,
354
352
}
355
353
}
Original file line number Diff line number Diff line change 1
1
//! Shared types for WebGPU errors. See also:
2
2
//! <https://gpuweb.github.io/gpuweb/#errors-and-debugging>
3
3
4
- use crate :: DeviceLostReason ;
5
-
6
4
/// A classification of WebGPU error for implementers of the WebGPU API to use in their own error
7
5
/// layer(s).
8
6
///
@@ -30,10 +28,7 @@ pub enum ErrorType {
30
28
/// property should be `resolve`d.
31
29
///
32
30
/// [`GPUDevice.lost`]: https://www.w3.org/TR/webgpu/#dom-gpudevice-lost
33
- DeviceLost {
34
- /// The reason the device was lost.
35
- reason : DeviceLostReason ,
36
- } ,
31
+ DeviceLost ,
37
32
}
38
33
39
34
/// A trait for querying the [`ErrorType`] classification of an error.
Original file line number Diff line number Diff line change @@ -7743,8 +7743,7 @@ mod send_sync {
7743
7743
impl < T > WasmNotSync for T { }
7744
7744
}
7745
7745
7746
- /// Corresponds to a [`GPUDeviceLostReason`]; usually seen by implementers of WebGPU with
7747
- /// [`error::ErrorType::DeviceLost::reason`].
7746
+ /// Corresponds to a [`GPUDeviceLostReason`].
7748
7747
///
7749
7748
/// [`GPUDeviceLostReason`]: https://www.w3.org/TR/webgpu/#enumdef-gpudevicelostreason
7750
7749
#[ repr( u8 ) ]
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ impl ContextWgpuCore {
335
335
description,
336
336
}
337
337
}
338
- ErrorType :: DeviceLost { reason : _ } => return ,
338
+ ErrorType :: DeviceLost => return , // will be surfaced via callback
339
339
} ;
340
340
sink. handle_error ( error) ;
341
341
}
You can’t perform that action at this time.
0 commit comments