diff --git a/crates/fj-viewer/src/graphics/device.rs b/crates/fj-viewer/src/graphics/device.rs index d1438fe52..d7972a351 100644 --- a/crates/fj-viewer/src/graphics/device.rs +++ b/crates/fj-viewer/src/graphics/device.rs @@ -53,6 +53,10 @@ impl Device { /// Render device initialization error #[derive(Debug, thiserror::Error)] pub enum DeviceError { + /// Failed to request adapter + #[error("Failed to request adapter")] + RequestAdapter, + /// Failed to request device #[error("Failed to request device")] RequestDevice(#[from] wgpu::RequestDeviceError), diff --git a/crates/fj-viewer/src/graphics/renderer.rs b/crates/fj-viewer/src/graphics/renderer.rs index a73590191..26fa5884f 100644 --- a/crates/fj-viewer/src/graphics/renderer.rs +++ b/crates/fj-viewer/src/graphics/renderer.rs @@ -57,7 +57,7 @@ impl Renderer { compatible_surface: Some(&surface), }) .await - .ok_or(RendererInitError::RequestAdapter)?; + .ok_or(RendererInitError::Device(DeviceError::RequestAdapter))?; debug!("Using adapter: {:?}", adapter.get_info()); @@ -374,10 +374,6 @@ pub enum RendererInitError { #[error("Error creating surface")] CreateSurface(#[from] wgpu::CreateSurfaceError), - /// Graphics accelerator acquisition error - #[error("Error request adapter")] - RequestAdapter, - /// Device error #[error(transparent)] Device(#[from] DeviceError),