File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ impl GPUError {
188188 fn from_webgpu ( e : impl WebGpuError ) -> Self {
189189 match e. webgpu_error_type ( ) {
190190 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.
192192 ErrorType :: OutOfMemory => GPUError :: OutOfMemory ,
193193 ErrorType :: Validation => GPUError :: Validation ( fmt_err ( & e) ) ,
194194 }
Original file line number Diff line number Diff line change @@ -347,9 +347,7 @@ impl WebGpuError for DeviceError {
347347 match self {
348348 DeviceError :: DeviceMismatch ( e) => e. webgpu_error_type ( ) ,
349349 Self :: ResourceCreationFailed => ErrorType :: OutOfMemory ,
350- Self :: Lost => ErrorType :: DeviceLost {
351- reason : DeviceLostReason :: Unknown ,
352- } ,
350+ Self :: Lost => ErrorType :: DeviceLost ,
353351 Self :: OutOfMemory => ErrorType :: OutOfMemory ,
354352 }
355353 }
Original file line number Diff line number Diff line change 11//! Shared types for WebGPU errors. See also:
22//! <https://gpuweb.github.io/gpuweb/#errors-and-debugging>
33
4- use crate :: DeviceLostReason ;
5-
64/// A classification of WebGPU error for implementers of the WebGPU API to use in their own error
75/// layer(s).
86///
@@ -30,10 +28,7 @@ pub enum ErrorType {
3028 /// property should be `resolve`d.
3129 ///
3230 /// [`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 ,
3732}
3833
3934/// 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 {
77437743 impl < T > WasmNotSync for T { }
77447744}
77457745
7746- /// Corresponds to a [`GPUDeviceLostReason`]; usually seen by implementers of WebGPU with
7747- /// [`error::ErrorType::DeviceLost::reason`].
7746+ /// Corresponds to a [`GPUDeviceLostReason`].
77487747///
77497748/// [`GPUDeviceLostReason`]: https://www.w3.org/TR/webgpu/#enumdef-gpudevicelostreason
77507749#[ repr( u8 ) ]
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ impl ContextWgpuCore {
335335 description,
336336 }
337337 }
338- ErrorType :: DeviceLost { reason : _ } => return ,
338+ ErrorType :: DeviceLost => return , // will be surfaced via callback
339339 } ;
340340 sink. handle_error ( error) ;
341341 }
You can’t perform that action at this time.
0 commit comments