Added begin/end CPU/GPU timer stats instead of elapsed.

This commit is contained in:
Branimir Karadžić
2015-11-09 17:56:12 -08:00
parent c179bd051d
commit c55a6101d2
8 changed files with 91 additions and 33 deletions

View File

@@ -6274,6 +6274,10 @@ namespace bgfx { namespace gl
elapsed += now;
static int64_t last = now;
Stats& perfStats = _render->m_perfStats;
perfStats.cpuTimeBegin = last;
int64_t frameTime = now - last;
last = now;
@@ -6301,10 +6305,10 @@ namespace bgfx { namespace gl
const int64_t timerFreq = bx::getHPFrequency();
Stats& perfStats = _render->m_perfStats;
perfStats.cpuTime = frameTime;
perfStats.cpuTimeEnd = now;
perfStats.cpuTimerFreq = timerFreq;
perfStats.gpuTime = elapsedGl;
perfStats.gpuTimeBegin = m_gpuTimer.m_begin;
perfStats.gpuTimeEnd = m_gpuTimer.m_end;
perfStats.gpuTimerFreq = 1000000000;
if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )