title HUD and dev overlay: VRAM from VK_EXT_memory_budget, private memory under Wine (RT-TITLE-HUD-VRAM-BUDGET) #2128
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2128
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2128/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@aslan2142 on GitHub · 2026-11-25 22:00 UTC · original
aslan2142:rt-title-hud-vram-budget→main· +577 −31 · 12 files · 3 commits · merged 2026-11-25 23:21 UTCClaimed in the coordination issue as: RT-TITLE-HUD-VRAM-BUDGET (#1608)
What and why
The title HUD from #1922 (kawaii-shakal, thanks) reads 0 for VRAM and private memory under Wine. This PR makes both figures real. It also shows them in the dev overlay from #2137 (Snooozs), which had neither figure: it showed the working set and free RAM only.
dxgi.dll'sQueryVideoMemoryInfo, which Wine answers with 0. It now reads the runtime's own Vulkan device.create_vulkan_device_standaloneenablesVK_EXT_memory_budgetwhen the GPU has it, like the other optional extensions, and records that asVulkanDeviceInfo::memory_budget.runtime/src/vulkan_memory_budget.hchainsVkPhysicalDeviceMemoryBudgetPropertiesEXTintovkGetPhysicalDeviceMemoryProperties2. It sumsheapUsageandheapBudgetover theDEVICE_LOCALheaps and reports the other heaps' usage as shared.rt::d3d12::vulkan_vram_budget(ID3D12Device*)reads one device.runtime/src/memory_figures.h:latest_vram()calls the reader at most once per 500 ms, for the HUD and the overlay together.VRAM n/ainstead of a false0.0/0.0.GetProcessMemoryInfofills only thePROCESS_MEMORY_COUNTERSpart and leavesPrivateUsageat 0. Measured intitle_hud_testunder Wine 11.22:PrivateUsage 0, PagefileUsage 6422528.PagefileUsageis the same commit-charge figure on Windows 8 and later, so both views show the larger of the two. If both are 0, they showRAM n/a.memory_figures.hholds the private-bytes choice, theRAM ...andVRAM ...text and the publisher.title_hud.handdev_overlay.hboth call it. It needs no Vulkan headers, and Win32 only under_WIN32, sodev_overlay_teststill builds on every host.... | RAM 2.5 GB (ws 1.0) | VRAM 3.5/16.0 GB +0.5 shared | ...RAM 2.5 GB (ws 1.0) VRAM 3.5/16.0 GB +0.5 shared.VRAM n/a.docs/boot.mdand theLEONIDA_DEV_OVERLAYrow ofruntime/README.md.Related: #2083 gates
title_hud_teston the Vulkan headers. It touches the same CMake target's registration, but not the lines this PR changes.Tested
dev_overlay_test(extended; it also builds and passes natively on Linux with g++):RAM n/a VRAM n/a) and with both;PagefileUsageonly, both, neither);title_hud_test:memoryHeapCount;d3d12_vram_budget_test(new; registered withSKIP_RETURN_CODE 77):n/aand skips.memory_figures.hand read the overlay's seventh line, so they fail or do not build without it.mainbaseline:absent -> passon each device:d3d12_vram_budget,title_hud,dev_overlayand 14 from merges since the baseline.tests/test_docs_*.py,test_text_write_line_endings.py,test_ci_registration.py,test_ctest_registration.pyandscripts/check_no_game_data.pyon the changed files all pass.GPUs tested: lavapipe (Mesa 26.3.1) and AMD Radeon iGPU gfx1036 (RADV, Mesa 26.3.1), Wine 11.22 (Staging) on Arch Linux. Both expose
VK_EXT_memory_budget.AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)@aslan2142 on GitHub · 2026-11-25 23:21 UTC · original
Merged. The title HUD (#1922) and the dev overlay (#2137) now show real memory figures under Wine.
VK_EXT_memory_budgeton the runtime's own device: used and budget over the device-local heaps, plus what the other heaps use as shared. It is read at most once per 500 ms for both views, and showsn/awithout the extension instead of a false 0.PrivateUsageandPagefileUsage, since Wine leaves the first at 0;n/awhen neither can be read.runtime/src/memory_figures.hfeeds both the HUD and the overlay. The device publishes its figure when it is created and withdraws it first thing on release.mainffcfe68f1(with #2137): no test went from pass to fail, anddev_overlay,title_hudandd3d12_vram_budgetpass on both. Not yet run on Windows itself or with the game.mainffcfe68f1+38385762b: it merges cleanly; the semantic suite passes (493 files, 6,318 tests, 0 files failed); the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 12 changed files.AI-assisted (Claude Code, Claude Opus 5.5).