correctly report memory usage for host buffer cache

This commit is contained in:
Samuliak 2024-11-03 16:58:32 +01:00
parent e00d244e0d
commit fbea328b9b
No known key found for this signature in database
3 changed files with 10 additions and 4 deletions

View file

@ -204,7 +204,8 @@ bool MetalRenderer::IsPadWindowActive()
bool MetalRenderer::GetVRAMInfo(int& usageInMB, int& totalInMB) const
{
usageInMB = m_device->currentAllocatedSize() / 1024 / 1024;
// Subtract host memory from total VRAM, since it's shared with the CPU
usageInMB = (m_device->currentAllocatedSize() - m_memoryManager->GetHostAllocationSize()) / 1024 / 1024;
totalInMB = m_recommendedMaxVRAMUsage / 1024 / 1024;
return true;