Repository navigation
gpui_interop 0.1.2
A producer-side ring that makes slow frames safe. No breaking API changes.
Added
WgpuSharedBufferRing(Linux,wgpufeature): a small ring of exportable frames for a producer that renders continuously.begin()hands out a free slot;submit()exports the frame with its acquire fence.present()returns only a frame whose acquire fence has already signalled, with the fence removed, or repeats the last good frame while a new one is in flight. GPUI's 16 ms poll never drops a slow frame.- Slots are recycled after the consumer's release, with a 250 ms timeout fallback. Frames overtaken by a newer one are dropped, so presentation does not jump backwards.
shared_buffer_ringintegration test (headless Vulkan): a deliberately long frame is never presented with a pending fence.
Why
GPUI's acquire-fence wait is CPU-side, 16 ms, before its draw is submitted — so sharing a device and queue does not help. A frame containing a full-screen overlay (~2.4 ms at 720p, ~5-6 ms at 1080p) can cross that boundary; the surface is then dropped, which shows as a black viewport frame. The ring removes the boundary: it never makes GPUI wait.
Reproduction: lengthening interop_wgpu's submission with extra clear passes produced 67 drops/10 s at 50 passes and 145 drops/10 s at 200. Every handle present() returns is fence-free, which the new regression test asserts.
Install
gpui_interop = { version = "0.1.2", features = ["gpui", "wgpu"] }Docs: https://docs.rs/gpui_interop/0.1.2
Changelog: https://github.com/bite-gpui/gpui_interop/blob/main/CHANGELOG.md
Full diff: v0.1.1...v0.1.2