1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 10:24:12 +01:00

[hud] Use different colors to highlight mapped or non-mapped allocations

Useful on UMA systems or when we have to fall back to system memory.
This commit is contained in:
Philip Rebohle 2024-09-21 15:37:24 +02:00 committed by Philip Rebohle
parent d00ca261af
commit 5c8728abd2
3 changed files with 7 additions and 4 deletions

View File

@ -613,6 +613,7 @@ namespace dxvk {
chunkStats.used = pool.pageAllocator.pagesUsed(i) * DxvkPageAllocator::PageSize;
chunkStats.pageMaskOffset = stats.pageMasks.size();
chunkStats.pageCount = pool.pageAllocator.pageCount(i);
chunkStats.mapped = &pool == &type.mappedPool;
size_t maskCount = (chunkStats.pageCount + 31u) / 32u;
stats.pageMasks.resize(chunkStats.pageMaskOffset + maskCount);

View File

@ -173,9 +173,11 @@ namespace dxvk {
VkDeviceSize used = 0u;
/// Index of first page mask belonging to this
/// chunk in the page mask array
size_t pageMaskOffset = 0u;
uint32_t pageMaskOffset = 0u;
/// Number of pages in this chunk.
size_t pageCount = 0u;
uint16_t pageCount = 0u;
/// Whether this chunk is mapped
bool mapped = false;
};

View File

@ -825,13 +825,13 @@ namespace dxvk::hud {
args.size = size;
if (!(memoryType.propertyFlags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT)) {
if (!(memoryType.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT))
if (!stats.mapped)
args.color = 0xff202020u;
else if (memoryType.propertyFlags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT)
args.color = 0xff208020u;
else
args.color = 0xff202080u;
} else if (memoryType.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
} else if (stats.mapped) {
args.color = 0xff208080u;
} else {
args.color = 0xff804020u;