From 58f7676f7b6f8a2cf82514b6663cd45cd76c0b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 9 Sep 2015 17:26:55 -0700 Subject: [PATCH] Added process memory usage info. --- src/renderer_d3d11.cpp | 6 +++++- src/renderer_d3d12.cpp | 6 +++++- src/renderer_d3d9.cpp | 4 ++++ src/renderer_gl.cpp | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index ebf5f249..0e5f3266 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -5053,10 +5053,14 @@ BX_PRAGMA_DIAGNOSTIC_POP(); char sharedSystem[16]; bx::prettify(sharedSystem, BX_COUNTOF(sharedSystem), desc.SharedSystemMemory); - tvm.printf(0, pos++, 0x8f, " Memory: %s (video), %s (system), %s (shared)" + char processMemoryUsed[16]; + bx::prettify(processMemoryUsed, BX_COUNTOF(processMemoryUsed), bx::getProcessMemoryUsed() ); + + tvm.printf(0, pos++, 0x8f, " Memory: %s (video), %s (system), %s (shared), %s (process) " , dedicatedVideo , dedicatedSystem , sharedSystem + , processMemoryUsed ); pos = 10; diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index cbf25666..7ce32b6f 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -4805,10 +4805,14 @@ data.NumQualityLevels = 0; char sharedSystem[16]; bx::prettify(sharedSystem, BX_COUNTOF(sharedSystem), desc.SharedSystemMemory); - tvm.printf(0, pos++, 0x8f, " Memory: %s (video), %s (system), %s (shared)" + char processMemoryUsed[16]; + bx::prettify(processMemoryUsed, BX_COUNTOF(processMemoryUsed), bx::getProcessMemoryUsed() ); + + tvm.printf(0, pos++, 0x8f, " Memory: %s (video), %s (system), %s (shared), %s (process) " , dedicatedVideo , dedicatedSystem , sharedSystem + , processMemoryUsed ); DXGI_QUERY_VIDEO_MEMORY_INFO memInfo; diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 3ae8964d..29683874 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -3750,6 +3750,10 @@ namespace bgfx { namespace d3d9 const D3DADAPTER_IDENTIFIER9& identifier = m_identifier; tvm.printf(0, pos++, 0x8f, " Device: %s (%s)", identifier.Description, identifier.Driver); + char processMemoryUsed[16]; + bx::prettify(processMemoryUsed, BX_COUNTOF(processMemoryUsed), bx::getProcessMemoryUsed() ); + tvm.printf(0, pos++, 0x8f, " Memory: %s (process) ", processMemoryUsed); + pos = 10; tvm.printf(10, pos++, 0x8e, " Frame: %7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] / % 6.2f FPS " , double(frameTime)*toMs diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 2ff369b6..4ae13f7e 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -6001,6 +6001,10 @@ namespace bgfx { namespace gl tvm.printf(0, pos++, 0x8f, " Version: %s ", m_version); tvm.printf(0, pos++, 0x8f, " GLSL version: %s ", m_glslVersion); + char processMemoryUsed[16]; + bx::prettify(processMemoryUsed, BX_COUNTOF(processMemoryUsed), bx::getProcessMemoryUsed() ); + tvm.printf(0, pos++, 0x8f, " Memory: %s (process) ", processMemoryUsed); + pos = 10; tvm.printf(10, pos++, 0x8e, " Frame CPU: %7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] / % 6.2f FPS " , double(frameTime)*toMs