Rust workspace for grafting an external GPU producer's texture onto
host-owned wgpu textures. The framework-agnostic
grafting crate provides the low-level interop (GL FBO /
Vulkan image / Metal IOSurface / DX12 shared texture into wgpu), a Servo
adapter sits on top, and nine demos show the embedding pattern across Rust
GUI frameworks. Derived from the
Slint Servo embedding example.
grafting0.4.0 published to crates.io 2026-08-10 (feature-selected wgpu 28/29, macOS build restored, DX12 shared-texture import as a free function). The repo carries 0.5.0 unreleased: Servo 0.4's surfman 0.13 plus a newwgpu-30feature row (eframe 0.36 is on wgpu 30; bevy 0.19 and slint 1.17 on 29; iced git on 28).- Servo demos track Servo
release/v0.4(tag v0.4.0); no local Servo checkout is needed. - Nine demos: eight Servo embeddings (winit, egui, iced, Blitz, Slint, Bevy, Xilem, GPUI) plus a Servo-free GL demo. Seven frameworks confirmed zero-copy on Windows; the full suite runs on Linux (Fedora 44 / Vulkan). Xilem and GPUI use CPU readback.
- Consumed by siblings: wgpu-weld's Windows import path delegates to
grafting; wgpu-scry was extracted from this repo. - Branch ladder:
main(newest tagged Servo release line),latest-release,experimental, kept in sync by scheduled workflows. Both forward branches are known red against Servo 0.5 (a freetype-sys links-key conflict with the vendored gpui fork); Servo 0.4 is unaffected.
Near-term plans: publish grafting 0.5.0 and clear the Servo 0.5 conflict.
Design docs and testing notes live in docs/.
grafting is for anyone importing a native GPU texture into a wgpu host:
cargo add grafting # wgpu-29 default; wgpu-30 and wgpu-28 behind featuresThe demos are copy-and-adapt references for embedding Servo web content in
a Rust GUI app; start from the one closest to your stack. Demos pin
different wgpu majors, so build them individually, not with --workspace:
cargo test -p grafting
cargo run -p demo-servo-winit -- https://servo.org
# also: -egui, -iced, -blitz, -slint, -bevy, -xilem, -gpui, demo-raw-glWindows notes: build Servo demos from a VS Developer Command Prompt; set
AWS_LC_SYS_NO_ASM=1 if nasm is absent; ANGLE DLLs are built and copied
next to the binary automatically. Rust is pinned at 1.97.1; the committed
Cargo.lock holds primeorder at 0.14.0-rc.14 (recover after a
cargo update with cargo update -p primeorder --precise 0.14.0-rc.14).
Bounded smoke run: pwsh -File scripts/smoke-demo.ps1 -Package demo-servo-winit -Seconds 15.
This README was generated by AI and will be edited by the author upon release.