linuxkms: Various fixes to fix compilation with wgpu/skia combinations#11410
Merged
linuxkms: Various fixes to fix compilation with wgpu/skia combinations#11410
Conversation
ogoffart
reviewed
Apr 16, 2026
ogoffart
approved these changes
Apr 16, 2026
Member
ogoffart
left a comment
There was a problem hiding this comment.
(i'm thinking we need more coverage in the CI for more combisation of feature)
…bled `cfg!()` evaluates at runtime, so both `new_wgpu_27_suspended` and `new_wgpu_28_suspended` needed to exist for compilation to succeed even when only one of `unstable-wgpu-27` / `unstable-wgpu-28` was enabled. Replace with `#[cfg]` attributes so the unsupported arm is stripped at compile time.
The wgpu-based Skia path was gated on the renderer-skia-vulkan feature, so with renderer-skia (opengl) + unstable-wgpu-28 the OpenGL path was picked and silently ignored the RequestedGraphicsAPI::WGPU28. The rendering notifier then received NativeOpenGL instead of WGPU28, so applications like the wgpu_texture example never had their DemoRenderer created and no texture was ever produced. Rename new_vulkan to new_wgpu and widen its cfg to be available whenever a wgpu feature is enabled, so the wgpu path is preferred over opengl when unstable-wgpu-28 is on.
Mirror the previous wgpu-28 fix for wgpu-27: widen the cfg gates on new_wgpu, the skia module, the skia-wgpu/skia-software renderer name arms, and wgpu_27_surface_target so the wgpu-backed Skia path is selected when unstable-wgpu-27 is enabled without requiring renderer-skia-vulkan. Without this, the bevy slint-hosts-bevy example fell back to the Skia OpenGL path and Bevy never received the wgpu device/queue via the rendering notifier. Also add a matching unstable-wgpu-27 feature to the linuxkms backend and propagate it from the backend selector.
Repeated any(feature = "renderer-skia-*", feature = "unstable-wgpu-27", feature = "unstable-wgpu-28") gates had grown hard to scan. Add a build.rs using cfg_aliases (same pattern the winit backend already uses) and introduce four aliases — enable_skia, enable_skia_wgpu, skia_wgpu_27, skia_wgpu_28 — then rewrite the matching gates across lib.rs, calloop_backend.rs, display.rs, drmoutput.rs, and renderer/skia.rs to use them. Also pull memmap2 into unstable-wgpu-27 / unstable-wgpu-28 so the software fallback paths (reached via the shared enable_skia gate on swdisplay) compile when only a wgpu feature is enabled.
dafdaab to
952192e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The cfg's are a bit of a mess, so fix some build combinations and attempt to simplify this using cfg-aliases.