feat(oak_bridge): macOS wgpu Metal texture to IOSurface CVPixelBuffer bridge

W3 of the oak task list. SurfaceBridge wraps an engine wgpu (Metal) texture
into an IOSurface-backed CVPixelBuffer for gpui's Surface element: a reused
pixel buffer created with kCVPixelBufferIOSurfacePropertiesKey +
MetalCompatibility, aliased to a Metal texture via gpui_media's
CVMetalTextureCache, with a GPU-to-GPU MTLBlitCommandEncoder copy (a
device.poll(Wait) before the blit keeps the v1 path correct and
synchronous). A CPU readback fallback (stage_readback/finish_readback)
works on any backend. The surface_bridge demo (demo feature) streams a
moving test pattern through the bridge into a window and prints FPS;
smoke-verified on macOS at 1280x720. Windows/Linux paths are left for a
follow-up (noted in docs/zh). 2 tests pass.
This commit is contained in:
2026-08-09 05:54:58 +08:00
parent d72d2e8210
commit 66b05b0ebe
7 changed files with 652 additions and 3 deletions
+1
View File
@@ -20,6 +20,7 @@ members = [
"./crates/gpui_zed_util/",
"./crates/gpui_ce_util/",
"./crates/gpui_widgets/",
"./crates/oak_bridge/",
"./tooling/perf/",
]
default-members = ["./crates/gpui/"]