mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-20 22:03:12 +01:00
Replaced bgfx::setProgram function with bgfx::submit argument. Added bgfx::touch and bgfx::getStats.
This commit is contained in:
@@ -3653,10 +3653,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
int64_t elapsed = -bx::getHPCounter();
|
||||
int64_t captureElapsed = 0;
|
||||
|
||||
if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
|
||||
{
|
||||
m_gpuTimer.begin();
|
||||
}
|
||||
m_gpuTimer.begin();
|
||||
|
||||
if (0 < _render->m_iboffset)
|
||||
{
|
||||
@@ -4442,31 +4439,39 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
min = min > frameTime ? frameTime : min;
|
||||
max = max < frameTime ? frameTime : max;
|
||||
|
||||
static uint32_t maxGpuLatency = 0;
|
||||
static double maxGpuElapsed = 0.0f;
|
||||
double elapsedGpuMs = 0.0;
|
||||
|
||||
m_gpuTimer.end();
|
||||
|
||||
while (m_gpuTimer.get() )
|
||||
{
|
||||
double toGpuMs = 1000.0 / double(m_gpuTimer.m_frequency);
|
||||
elapsedGpuMs = m_gpuTimer.m_elapsed * toGpuMs;
|
||||
maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
|
||||
}
|
||||
maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
|
||||
|
||||
const int64_t timerFreq = bx::getHPFrequency();
|
||||
|
||||
Stats& perfStats = _render->m_perfStats;
|
||||
perfStats.cpuTime = frameTime;
|
||||
perfStats.cpuTimerFreq = timerFreq;
|
||||
perfStats.gpuTime = m_gpuTimer.m_elapsed;
|
||||
perfStats.gpuTimerFreq = m_gpuTimer.m_frequency;
|
||||
|
||||
if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
|
||||
{
|
||||
PIX_BEGINEVENT(D3DCOLOR_RGBA(0x40, 0x40, 0x40, 0xff), L"debugstats");
|
||||
|
||||
static uint32_t maxGpuLatency = 0;
|
||||
static double maxGpuElapsed = 0.0f;
|
||||
double elapsedGpuMs = 0.0;
|
||||
|
||||
m_gpuTimer.end();
|
||||
|
||||
while (m_gpuTimer.get() )
|
||||
{
|
||||
double toGpuMs = 1000.0 / double(m_gpuTimer.m_frequency);
|
||||
elapsedGpuMs = m_gpuTimer.m_elapsed * toGpuMs;
|
||||
maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
|
||||
}
|
||||
maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
|
||||
|
||||
TextVideoMem& tvm = m_textVideoMem;
|
||||
|
||||
static int64_t next = now;
|
||||
|
||||
if (now >= next)
|
||||
{
|
||||
next = now + bx::getHPFrequency();
|
||||
next = now + timerFreq;
|
||||
double freq = double(bx::getHPFrequency() );
|
||||
double toMs = 1000.0/freq;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user