Skip to content

Commit

Permalink
Updated stats display.
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed Mar 27, 2015
1 parent 53b9e90 commit dc60f34
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/renderer_d3d11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) )
{
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion src/renderer_d3d9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion src/renderer_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) )
{
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dc60f34

Please sign in to comment.