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.5.1 is the published baseline;mainis the 0.6.0 compatibility revision. It makes borrowed Metal frame descriptors move-only and carries feature-selected wgpu 28/29/30, including the corrected wgpu-28 Metal arm. wgpu 29 remains the default while the GUI ecosystem straddles majors.- Servo demos track Servo
release/v0.5(tag v0.5.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. Six Servo GUI paths use GPU import; Xilem and GPUI intentionally demonstrate CPU readback. Bevy and Iced are DX12-specific; the other six Servo demos are checked on Linux, macOS, and Windows.
- Consumed by siblings: wgpu-weld and wgpu-scry delegate their native
Metal/Vulkan import boundaries to
grafting; producer policy stays local. - Linux foreign-image consumers construct the unified host device through
vulkan_dmabuf::create_dmabuf_host_context, which enables the complete external-memory, DRM-modifier, and foreign-queue extension set. - Trusted RADV, NVIDIA, Apple Silicon, and Intel Mac runners execute the reference Servo demo's deterministic imported-pixel, input, and resize gate. RADV also executes RGBA and BGRA DMA-BUF pixel round trips. Shared-allocation multi-plane layouts are supported; disjoint plane allocations return a specific typed error and close every transferred fd.
mainis the one supported repository line. A weekly workflow keeps its Servo pin on the newest tagged release line. The unusedlatest-releaseandexperimentallines were retired on 2026-08-30; their last reachable tips contained no history absent frommain.
Release plans and active design policy live in design_docs/. Older project
context and testing notes still live in docs/ until a doc-hygiene pass moves
or archives them.
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: scripts/check-servo-demos.ps1 selects desktop LLVM for
bindgen, avoiding ESP-IDF LIBCLANG_PATH contamination, and validates MSVC,
the Windows SDK, CMake, NASM, and Git long-path support before compilation. It
checks each root demo in its own Cargo graph; pass -IncludeIced for the
adjacent Iced workspace, or -CargoCommand build to compile and link the
binaries. The minimum parallelism is -Jobs 2 because WebRender's shader
optimizer needs a jobserver worker. CI also sets AWS_LC_SYS_NO_ASM=1, but
keeps NASM installed for the remaining aws-lc paths. ANGLE DLLs are built and
copied next to the binary automatically. Rust is pinned at 1.97.1.
Bounded smoke run: pwsh -File scripts/smoke-demo.ps1. It requires a GPU
imported pixel receipt, a page-observed click, and a resized imported frame.
This README was generated by AI and will be edited by the author upon release.