Fixed GPU timer read-back.

This commit is contained in:
Branimir Karadžić 2016-06-13 16:45:29 -07:00
parent d8d17994dc
commit 00a2a9c964
4 changed files with 12 additions and 4 deletions

View File

@ -5958,12 +5958,14 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
m_gpuTimer.end();
while (m_gpuTimer.get() )
do
{
double toGpuMs = 1000.0 / double(m_gpuTimer.m_frequency);
elapsedGpuMs = m_gpuTimer.m_elapsed * toGpuMs;
maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
}
while (m_gpuTimer.get() );
maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
}

View File

@ -5413,12 +5413,14 @@ data.NumQualityLevels = 0;
m_gpuTimer.end(m_commandList);
while (m_gpuTimer.get() )
do
{
double toGpuMs = 1000.0 / double(m_gpuTimer.m_frequency);
elapsedGpuMs = m_gpuTimer.m_elapsed * toGpuMs;
maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
}
while (m_gpuTimer.get() );
maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
const int64_t timerFreq = bx::getHPFrequency();

View File

@ -4188,12 +4188,14 @@ namespace bgfx { namespace d3d9
{
m_gpuTimer.end();
while (m_gpuTimer.get() )
do
{
double toGpuMs = 1000.0 / double(m_gpuTimer.m_frequency);
elapsedGpuMs = m_gpuTimer.m_elapsed * toGpuMs;
maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
}
while (m_gpuTimer.get() );
maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
}

View File

@ -6791,12 +6791,14 @@ namespace bgfx { namespace gl
if (m_timerQuerySupport)
{
m_gpuTimer.end();
while (m_gpuTimer.get() )
do
{
elapsedGl = m_gpuTimer.m_elapsed;
elapsedGpuMs = double(elapsedGl)/1e6;
maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
}
while (m_gpuTimer.get() );
maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
}