From 25d75e2a0242c66d5dedd17d2db7c51ebc1cf2b7 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Tue, 1 Jul 2025 16:24:07 +0200 Subject: [PATCH] remove `DeviceError::Invalid`, this variant should be the same as `DeviceError::Lost` --- wgpu-core/src/device/mod.rs | 3 --- wgpu-core/src/device/resource.rs | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 41ea53db1..40b01b5b4 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -332,8 +332,6 @@ impl WebGpuError for DeviceMismatch { #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[non_exhaustive] pub enum DeviceError { - #[error("{0} is invalid.")] - Invalid(ResourceErrorIdent), #[error("Parent device is lost")] Lost, #[error("Not enough memory left.")] @@ -348,7 +346,6 @@ impl WebGpuError for DeviceError { fn webgpu_error_type(&self) -> ErrorType { match self { DeviceError::DeviceMismatch(e) => e.webgpu_error_type(), - Self::Invalid(_) => ErrorType::Validation, Self::ResourceCreationFailed => ErrorType::OutOfMemory, Self::Lost => ErrorType::DeviceLost { reason: DeviceLostReason::Unknown, diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index 86bb5eb9b..ef044f2f9 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -357,7 +357,7 @@ impl Device { if self.is_valid() { Ok(()) } else { - Err(DeviceError::Invalid(self.error_ident())) + Err(DeviceError::Lost) } }