diff --git a/runtime/shims/d3d12_vulkan_device.cpp b/runtime/shims/d3d12_vulkan_device.cpp index 1c97dad489..1b14948900 100644 --- a/runtime/shims/d3d12_vulkan_device.cpp +++ b/runtime/shims/d3d12_vulkan_device.cpp @@ -22463,19 +22463,30 @@ class Device final peak = d.arena.peak_end; for (int i = 0; i < DeviceState::arena_use_count; ++i) use[i] = d.arena.use_in_use[i]; } - char text[512]; + // VK_EXT_memory_budget: what the driver says the device-local heaps can hold, and what this process + // holds of them. It is not the card's size: on the 24 GB card here the heap is 24138 MiB and the + // budget 23370, and the smaller the card the wider that gap matters, since the budget is what a + // failure is measured against (a title that settles at 7.7 GB is over an 8 GB card's budget + // before it allocates anything more). Empty when the extension or the device does not report it. + char vram[96] = ""; + const leonida::VramBudget budget = read_vram_budget(d.info); + if (budget.available) + std::snprintf(vram, sizeof vram, "; VRAM %.1f/%.1f GB", + double(budget.local_usage) / double(1ull << 30), + double(budget.local_budget) / double(1ull << 30)); + char text[768]; std::snprintf(text, sizeof text, "pipeline cache %.0f MiB; arena %.0f MiB (type %u), in use %.0f MiB (buffer %.0f, " "descriptor heap %.0f, shader %.0f, heap %.0f, windows/shadows %.0f), peak end %.0f MiB; " "title memory %llu ranges %.0f MiB reserved/committed VA; shadows %llu; fsdraw pipeline " - "notes %zu", + "notes %zu%s", leonida::mem_probe::mib(cache), leonida::mem_probe::mib(d.arena.size), d.arena.memory_type, leonida::mem_probe::mib(in_use), leonida::mem_probe::mib(use[0]), leonida::mem_probe::mib(use[1]), leonida::mem_probe::mib(use[2]), leonida::mem_probe::mib(use[3]), leonida::mem_probe::mib(use[DeviceState::arena_window]), leonida::mem_probe::mib(peak), (unsigned long long)title_ranges, leonida::mem_probe::mib(title), - (unsigned long long)shadows, leonida::fsdraw::pipeline_count()); + (unsigned long long)shadows, leonida::fsdraw::pipeline_count(), vram); return std::string(text); }; facts.share = [this] {