Skip to content

linuxkms: Various fixes to fix compilation with wgpu/skia combinations#11410

Merged
tronical merged 5 commits intomasterfrom
simon/servo-linuxkms
Apr 17, 2026
Merged

linuxkms: Various fixes to fix compilation with wgpu/skia combinations#11410
tronical merged 5 commits intomasterfrom
simon/servo-linuxkms

Conversation

@tronical
Copy link
Copy Markdown
Member

The cfg's are a bit of a mess, so fix some build combinations and attempt to simplify this using cfg-aliases.

Comment thread internal/backends/linuxkms/build.rs Outdated
Copy link
Copy Markdown
Member

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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.
@tronical tronical enabled auto-merge (rebase) April 17, 2026 11:40
@tronical tronical merged commit 32988f5 into master Apr 17, 2026
54 checks passed
@tronical tronical deleted the simon/servo-linuxkms branch April 17, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants