mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #2128] [MERGED] title HUD and dev overlay: VRAM from VK_EXT_memory_budget, private memory under Wine (RT-TITLE-HUD-VRAM-BUDGET) #2132
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2132
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2128
Author: @aslan2142
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142
Base:
main← Head:rt-title-hud-vram-budget📝 Commits (3)
2443875title HUD: VRAM from VK_EXT_memory_budget, private bytes under Wined4fb292Merge main into rt-title-hud-vram-budget3838576dev overlay: the title HUD's VRAM and private memory figures📊 Changes
12 files changed (+577 additions, -31 deletions)
View changed files
📝
docs/boot.md(+9 -3)📝
runtime/CMakeLists.txt(+7 -0)📝
runtime/README.md(+1 -1)📝
runtime/shims/d3d12_com.h(+8 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+23 -0)📝
runtime/shims/title_hud.h(+38 -17)📝
runtime/src/dev_overlay.h(+11 -7)➕
runtime/src/memory_figures.h(+147 -0)➕
runtime/src/vulkan_memory_budget.h(+46 -0)➕
runtime/test/d3d12_vram_budget_test.cpp(+103 -0)📝
runtime/test/dev_overlay_test.cpp(+70 -2)📝
runtime/test/title_hud_test.cpp(+114 -1)📄 Description
Claimed in the coordination issue as: RT-TITLE-HUD-VRAM-BUDGET (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172679484)
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)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.