Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions runtime/shims/d3d12_vulkan_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand Down
Loading