Skip to content

Commit 7523736

Browse files
committed
Revert portion of #6510 that changes the interface
1 parent 8610e5e commit 7523736

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

wgpu-core/src/instance.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,13 @@ impl Surface {
412412
&self,
413413
adapter: &hal::DynExposedAdapter,
414414
) -> Result<hal::SurfaceCapabilities, GetSurfaceSupportError> {
415-
let backend = adapter.backend();
416415
let suf = self
417-
.raw(backend)
418-
.ok_or(GetSurfaceSupportError::NotSupportedByBackend(backend))?;
416+
.raw(adapter.backend())
417+
.ok_or(GetSurfaceSupportError::Unsupported)?;
419418
profiling::scope!("surface_capabilities");
420419
let caps = unsafe { adapter.adapter.surface_capabilities(suf) }
421-
.ok_or(GetSurfaceSupportError::FailedToRetrieveSurfaceCapabilitiesForAdapter)?;
420+
.ok_or(GetSurfaceSupportError::Unsupported)?;
421+
422422
Ok(caps)
423423
}
424424

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

658656
#[derive(Clone, Debug, Error)]

0 commit comments

Comments
 (0)