Skip to content

Commit ce4283e

Browse files
committed
winit: Fix explicit renderer-femtovg-wgpu selection
When no graphics API is requested by the app, permit the selection to continue.
1 parent 499a8a7 commit ce4283e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

internal/backends/winit/lib.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -384,17 +384,14 @@ impl BackendBuilder {
384384
}
385385
#[cfg(feature = "renderer-femtovg-wgpu")]
386386
(Some("femtovg-wgpu"), maybe_graphics_api) => {
387-
if !maybe_graphics_api.is_some_and(|_api| {
387+
if let Some(_api) = maybe_graphics_api {
388388
#[cfg(feature = "unstable-wgpu-27")]
389-
if matches!(_api, RequestedGraphicsAPI::WGPU27(..)) {
390-
return true;
389+
if !matches!(_api, RequestedGraphicsAPI::WGPU27(..)) {
390+
return Err(
391+
"The FemtoVG WGPU renderer only supports the WGPU27 graphics API selection"
392+
.into(),
393+
);
391394
}
392-
false
393-
}) {
394-
return Err(
395-
"The FemtoVG WGPU renderer only supports the WGPU27 graphics API selection"
396-
.into(),
397-
);
398395
}
399396
renderer::femtovg::WGPUFemtoVGRenderer::new_suspended
400397
}

0 commit comments

Comments
 (0)