From dc60f348837811065f8472f9013fcf4755010765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 26 Mar 2015 22:43:50 -0700 Subject: [PATCH] Updated stats display. --- src/renderer_d3d11.cpp | 7 ++++++- src/renderer_d3d9.cpp | 6 +++++- src/renderer_gl.cpp | 7 ++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 6dafafbf..a79a5145 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -3146,6 +3146,7 @@ namespace bgfx { namespace d3d11 uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumIndices = 0; + uint32_t statsKeyType[2] = {}; if (0 == (_render->m_debug&BGFX_DEBUG_IFH) ) { @@ -3158,6 +3159,8 @@ namespace bgfx { namespace d3d11 for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;) { const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap); + statsKeyType[isCompute]++; + const bool viewChanged = 0 || key.m_view != view || item == numItems @@ -3801,8 +3804,10 @@ namespace bgfx { namespace d3d11 ); double elapsedCpuMs = double(elapsed)*toMs; - tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / CPU %3.4f [ms]" + tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms]" , _render->m_num + , statsKeyType[0] + , statsKeyType[1] , elapsedCpuMs ); for (uint32_t ii = 0; ii < BX_COUNTOF(s_primName); ++ii) diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 83b08b72..c034c071 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -2888,6 +2888,7 @@ namespace bgfx { namespace d3d9 uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumIndices = 0; + uint32_t statsKeyType[2] = {}; invalidateSamplerState(); @@ -2896,6 +2897,7 @@ namespace bgfx { namespace d3d9 for (uint32_t item = 0, numItems = _render->m_num; item < numItems; ++item) { const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap); + statsKeyType[isCompute]++; if (isCompute) { @@ -3426,8 +3428,10 @@ namespace bgfx { namespace d3d9 ); double elapsedCpuMs = double(elapsed)*toMs; - tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / CPU %3.4f [ms]" + tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms]" , _render->m_num + , statsKeyType[0] + , statsKeyType[1] , elapsedCpuMs ); for (uint32_t ii = 0; ii < BX_COUNTOF(s_primName); ++ii) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index e1ed1543..3dec6c41 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -4421,6 +4421,7 @@ namespace bgfx { namespace gl uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumIndices = 0; + uint32_t statsKeyType[2] = {}; if (0 == (_render->m_debug&BGFX_DEBUG_IFH) ) { @@ -4435,6 +4436,8 @@ namespace bgfx { namespace gl for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;) { const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap); + statsKeyType[isCompute]++; + const bool viewChanged = 0 || key.m_view != view || item == numItems @@ -5236,8 +5239,10 @@ namespace bgfx { namespace gl ); double elapsedCpuMs = double(elapsed)*toMs; - tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / CPU %3.4f [ms] %c GPU %3.4f [ms]" + tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms] %c GPU %3.4f [ms]" , _render->m_num + , statsKeyType[0] + , statsKeyType[1] , elapsedCpuMs , elapsedCpuMs > elapsedGpuMs ? '>' : '<' , elapsedGpuMs