Skip to content

Commit

Permalink
Refactor to prepare for follow-on change
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Sep 29, 2023
1 parent f8bcfd4 commit 6edf455
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions crates/fj-viewer/src/graphics/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 1 addition & 5 deletions crates/fj-viewer/src/graphics/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 6edf455

Please sign in to comment.