mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-21 14:23:02 +01:00
Added begin/end CPU/GPU timer stats instead of elapsed.
This commit is contained in:
@@ -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) )
|
||||
|
||||
Reference in New Issue
Block a user