Exposed a few more internal performats stats.

This commit is contained in:
Branimir Karadžić 2016-12-19 17:18:07 -08:00
parent c35d3c2d6f
commit 5a0d824331
8 changed files with 69 additions and 43 deletions

View File

@ -721,6 +721,10 @@ namespace bgfx
//! draw commands to underlying graphics API.
int64_t waitSubmit; //!< Time spent waiting for submit thread to advance to next frame.
uint32_t numDraw; //!< Number of draw calls submitted.
uint32_t numCompute; //!< Number of compute calls submitted.
uint32_t maxGpuLatency; //!< GPU driver latency.
uint16_t width; //!< Backbuffer width in pixels.
uint16_t height; //!< Backbuffer height in pixels.
uint16_t textWidth; //!< Debug text width in characters.

View File

@ -330,6 +330,10 @@ typedef struct bgfx_stats
int64_t waitRender;
int64_t waitSubmit;
uint32_t numDraw;
uint32_t numCompute;
uint32_t maxGpuLatency;
uint16_t width;
uint16_t height;
uint16_t textWidth;

View File

@ -6187,6 +6187,9 @@ BX_PRAGMA_DIAGNOSTIC_POP();
perfStats.gpuTimeBegin = m_gpuTimer.m_begin;
perfStats.gpuTimeEnd = m_gpuTimer.m_end;
perfStats.gpuTimerFreq = m_gpuTimer.m_frequency;
perfStats.numDraw = statsKeyType[0];
perfStats.numCompute = statsKeyType[1];
perfStats.maxGpuLatency = maxGpuLatency;
if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
{

View File

@ -5485,6 +5485,9 @@ data.NumQualityLevels = 0;
perfStats.gpuTimeBegin = m_gpuTimer.m_begin;
perfStats.gpuTimeEnd = m_gpuTimer.m_end;
perfStats.gpuTimerFreq = m_gpuTimer.m_frequency;
perfStats.numDraw = statsKeyType[0];
perfStats.numCompute = statsKeyType[1];
perfStats.maxGpuLatency = maxGpuLatency;
if (_render->m_debug & (BGFX_DEBUG_IFH | BGFX_DEBUG_STATS) )
{

View File

@ -4264,6 +4264,9 @@ namespace bgfx { namespace d3d9
perfStats.gpuTimeBegin = m_gpuTimer.m_begin;
perfStats.gpuTimeEnd = m_gpuTimer.m_end;
perfStats.gpuTimerFreq = m_gpuTimer.m_frequency;
perfStats.numDraw = statsKeyType[0];
perfStats.numCompute = statsKeyType[1];
perfStats.maxGpuLatency = maxGpuLatency;
if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
{

View File

@ -7314,6 +7314,9 @@ namespace bgfx { namespace gl
perfStats.gpuTimeBegin = m_gpuTimer.m_begin;
perfStats.gpuTimeEnd = m_gpuTimer.m_end;
perfStats.gpuTimerFreq = 1000000000;
perfStats.numDraw = statsKeyType[0];
perfStats.numCompute = statsKeyType[1];
perfStats.maxGpuLatency = maxGpuLatency;
if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
{

View File

@ -3755,6 +3755,9 @@ namespace bgfx { namespace mtl
perfStats.gpuTimeBegin = m_gpuTimer.m_begin;
perfStats.gpuTimeEnd = m_gpuTimer.m_end;
perfStats.gpuTimerFreq = m_gpuTimer.m_frequency;
perfStats.numDraw = statsKeyType[0];
perfStats.numCompute = statsKeyType[1];
perfStats.maxGpuLatency = maxGpuLatency;
rce.setTriangleFillMode(MTLTriangleFillModeFill);
if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )

View File

@ -4430,6 +4430,9 @@ BX_UNUSED(presentMin, presentMax);
// perfStats.gpuTimeBegin = m_gpuTimer.m_begin;
// perfStats.gpuTimeEnd = m_gpuTimer.m_end;
// perfStats.gpuTimerFreq = m_gpuTimer.m_frequency;
// perfStats.numDraw = statsKeyType[0];
// perfStats.numCompute = statsKeyType[1];
// perfStats.maxGpuLatency = maxGpuLatency;
if (_render->m_debug & (BGFX_DEBUG_IFH | BGFX_DEBUG_STATS) )
{