enum DesktopDiagnostics
Swift
enum DesktopDiagnostics
What the compositor knows about its own GPU memory.
Separate from DesktopSettings because nothing here is a setting: these are
questions, and the answers change on their own. They live in LavaClient
rather than in the app that asks them so that anything — a debug window, a
test, a one-shot CLI — can ask without reimplementing the round trip.
Only the compositor can answer. It renders every LavaUI surface on the desktop on a single Vulkan device, so the attachments, the glyph atlas and the texture cache behind all the windows are one process's memory, and no client can see any of it from inside its own window.
Synchronous, like DesktopSettings, and for the same reason: the call lands
on the compositor's event loop and answers in microseconds.
Sources/LavaClient/DesktopDiagnostics.swift:19
Properties
static var isAvailable: Bool { get }
Whether there is a compositor to ask.
Sources/LavaClient/DesktopDiagnostics.swift:21
Methods
static func dumpAtlasImages(into directory: String) throws -> [String]
Writes each atlas page under directory as a PNG; returns the paths.
The compositor's filesystem, which for a debug app on the same machine
is also its own — so the returned paths can be handed straight to
Image(path:). An empty result means there were no atlas pages, not
that writing failed; failure throws.
Slow on purpose: every page is copied off the GPU. Bind it to a button, never to a timer.
Sources/LavaClient/DesktopDiagnostics.swift:41
static func gpuReport() throws -> GpuReport
Everything in VRAM, and who asked for it.
Poll it — a second is a sensible interval. There is deliberately no stream: allocations happen at window creation, resize and atlas growth, which is far too bursty to subscribe to and far too rare to need to.
Sources/LavaClient/DesktopDiagnostics.swift:28