# wgpu-graft

A Rust library that grafts textures from another GPU API, OpenGL, Vulkan, Metal, or DirectX 12, onto host-owned wgpu textures, letting a wgpu-based Rust GUI embed a renderer such as Servo without a CPU copy.

wgpu-graft provides the low-level interop needed to import a texture produced by another GPU API, an OpenGL framebuffer object, a Vulkan image, a Metal IOSurface, or a DirectX 12 shared texture, into a wgpu-owned texture on the same machine, without reading the pixels back through the CPU. A framework-agnostic core crate handles the interop itself, an adapter sits on top for embedding the Servo browser engine, and nine demos show the same embedding pattern across different Rust GUI frameworks, including winit, egui, iced, Blitz, Slint, Bevy, Xilem, and GPUI.

Six of the demonstrated GUI paths use real GPU texture import, while two intentionally demonstrate a CPU-readback fallback instead, and the demos are checked across Linux, macOS, and Windows depending on the graphics API involved. Two sibling projects reuse this crate's Metal and Vulkan import code, and the library is meant for any project that needs to import a native GPU texture into a wgpu host.

Website: https://github.com/merely-made/wgpu-graft
