Merge pull request #789 from nem0/master

waitRender and waitSubmit in the stats
This commit is contained in:
Branimir Karadžić 2016-05-15 08:31:13 -07:00
commit 133b9c42f1
4 changed files with 10 additions and 1 deletions

View File

@ -246,7 +246,9 @@ class ExampleDrawStress : public entry::AppI
const bgfx::Stats* stats = bgfx::getStats();
imguiLabel("GPU %0.6f [ms]", double(stats->gpuTimeEnd - stats->gpuTimeBegin)*1000.0/stats->gpuTimerFreq);
imguiLabel("CPU %0.6f [ms]", double(stats->cpuTimeEnd - stats->cpuTimeBegin)*1000.0/stats->cpuTimerFreq);
imguiLabel("Waiting for render thread %0.6f [ms]", double(stats->waitRender) * toMs);
imguiLabel("Waiting for submit thread %0.6f [ms]", double(stats->waitSubmit) * toMs);
imguiEndScrollArea();
imguiEndFrame();

View File

@ -640,6 +640,9 @@ namespace bgfx
uint64_t gpuTimeBegin; //!< GPU frame begin time.
uint64_t gpuTimeEnd; //!< GPU frame end time.
uint64_t gpuTimerFreq; //!< GPU timer frequency.
int64_t waitRender; //!< Render wait time.
int64_t waitSubmit; //!< Submit wait time.
};
/// Vertex declaration.

View File

@ -307,6 +307,8 @@ typedef struct bgfx_stats
uint64_t gpuTimeEnd;
uint64_t gpuTimerFreq;
int64_t waitRender;
int64_t waitSubmit;
} bgfx_stats_t;
/**/

View File

@ -3892,6 +3892,7 @@ namespace bgfx
bool ok = m_gameSem.wait();
BX_CHECK(ok, "Semaphore wait failed."); BX_UNUSED(ok);
m_render->m_waitSubmit = bx::getHPCounter()-start;
m_submit->m_perfStats.waitSubmit = m_submit->m_waitSubmit;
}
}
@ -3912,6 +3913,7 @@ namespace bgfx
bool ok = m_renderSem.wait();
BX_CHECK(ok, "Semaphore wait failed."); BX_UNUSED(ok);
m_submit->m_waitRender = bx::getHPCounter() - start;
m_submit->m_perfStats.waitRender = m_submit->m_waitRender;
}
}