Skip to content

Commit

Permalink
Revert portion of #6510 that changes the interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Nov 24, 2024
1 parent 8610e5e commit 7523736
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions wgpu-core/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,13 @@ impl Surface {
&self,
adapter: &hal::DynExposedAdapter,
) -> Result<hal::SurfaceCapabilities, GetSurfaceSupportError> {
let backend = adapter.backend();
let suf = self
.raw(backend)
.ok_or(GetSurfaceSupportError::NotSupportedByBackend(backend))?;
.raw(adapter.backend())
.ok_or(GetSurfaceSupportError::Unsupported)?;
profiling::scope!("surface_capabilities");
let caps = unsafe { adapter.adapter.surface_capabilities(suf) }
.ok_or(GetSurfaceSupportError::FailedToRetrieveSurfaceCapabilitiesForAdapter)?;
.ok_or(GetSurfaceSupportError::Unsupported)?;

Ok(caps)
}

Expand Down Expand Up @@ -649,10 +649,8 @@ crate::impl_storage_item!(Adapter);
#[derive(Clone, Debug, Error)]
#[non_exhaustive]
pub enum GetSurfaceSupportError {
#[error("Surface is not supported for the specified backend {0}")]
NotSupportedByBackend(Backend),
#[error("Failed to retrieve surface capabilities for the specified adapter.")]
FailedToRetrieveSurfaceCapabilitiesForAdapter,
#[error("Surface is not supported by the adapter")]
Unsupported,
}

#[derive(Clone, Debug, Error)]
Expand Down

0 comments on commit 7523736

Please sign in to comment.