Some background. We're a small studio, and in our co-op game the UI changed after every playtest. Move this button left, make that bar thicker. In Unity that meant a recompile, a scene restart, and a dozen clicks just to get back to the same screen. I've written web stuff for years, so it drove me nuts that browsers solved this ages ago and I couldn't use any of it.
The thing I wanted already exists. Coherent Gameface is built for game UI and has renderers for DX11, DX12, GL, Metal, and consoles. But there's no price on the site. You ask sales for a quote, the licence is per title and per platform, and source access costs extra. For a team our size, that conversation never starts. Ultralight is free until you make money, which is a bad time to learn the licence terms. CEF puts all of Chromium in your game, with a second process tree and 100+ MB to show a dozen screens. UI Toolkit looks like HTML and CSS but isn't, so my web experience didn't carry over.
I wrote my own, with one rule: don't build a second browser. A browser has to render any page on the internet. My UI renders one page that ships with the game, so networking, origins, cookies, history, and process isolation can go. I used lexbor for HTML, V8 for JS, Yoga for flexbox, and Skia for text and raster. The DOM, the cascade, and paint order are mine, about 20k lines of C++20. The cascade alone is 5,800 lines, more than layout and paint together. Didn't see that coming.
So...
The part this sub might care about: I refused to copy a texture every frame. Skia's GrDirectContext is created on Unity's own ID3D12Device and command queue (IUnityGraphicsD3D12v8, plugin event with kUnityD3D12GraphicsQueueAccess_Allow). The texture is a committed resource with ALLOW_RENDER_TARGET | ALLOW_SIMULTANEOUS_ACCESS, wrapped in an SkSurface, and C# gets it through Texture2D.CreateExternalTexture. Skia draws into the same texture the RawImage samples, and sync is just command order on one queue.
Resource states were the annoying bit. Unity doesn't say what state it expects an external texture in, and Skia's D3D backend ignores MutableTextureState, so after flush the resource sits in COMMON and you rely on implicit promotion and decay. I didn't trust that until I ran Unity with the debug layer on. That run found one real bug: a SampleDesc.Quality mismatch from a default fSampleQualityPattern in a Skia struct. One line to fix. Zero D3D12 errors since.
What I'm happiest about is boring: UI that doesn't move costs nothing. A frame gets published only when something changes, and only the damaged rect is repainted (old and new box bounds, padded for shadows). With software raster at 800x600, an idle menu went from 22.7 ms a frame to zero. A HUD with one animated element went from 15.9 ms to 0.115 ms, because it repaints 22x22 px instead of the whole view. In our game, we then cut the HUD into 11 small views. At 1080p on CPU raster, that's 282.6 ms down to 9.7 ms per frame, while texture memory went from 7.9 to 15 MB.
To be fair to Gameface, it's miles ahead on coverage. My fast path is Windows + D3D12 only, and everything else falls back to a CPU rasteriser. No grid, no calc(), no custom properties, no ::before/::after. If you ship on consoles, just pay them. What I get back is Apache-2.0 with only permissive deps, and when something breaks, I open the source instead of a support ticket. For me, that was worth nine months.
v0.9, 310 native tests with pixel goldens, 46 PlayMode tests on a real D3D12 device.
https://github.com/Rovniy/xploit_game_ui
If you've put Skia (or your own renderer) on a host engine's D3D12 queue, did you trust simultaneous access like I did, or track states yourself?
AI disclosure: I wrote the code with Claude Code as a coding assistant, and most commits in the repo are co-authored with it. The architecture, the D3D12 interop, and the debugging were my calls, and every number above comes from my own runs. This post was drafted with Claude from my blog post and the repo docs, then edited by me. The cover image is AI-generated.