|
|
@@ -4475,7 +4475,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|
|
DX_CHECK(device->CreateQuery(&query, &frame.m_disjoint) );
|
|
|
|
|
|
query.Query = D3D11_QUERY_TIMESTAMP;
|
|
|
- DX_CHECK(device->CreateQuery(&query, &frame.m_start) );
|
|
|
+ DX_CHECK(device->CreateQuery(&query, &frame.m_begin) );
|
|
|
DX_CHECK(device->CreateQuery(&query, &frame.m_end) );
|
|
|
}
|
|
|
|
|
|
@@ -4490,7 +4490,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|
|
{
|
|
|
Frame& frame = m_frame[ii];
|
|
|
DX_RELEASE(frame.m_disjoint, 0);
|
|
|
- DX_RELEASE(frame.m_start, 0);
|
|
|
+ DX_RELEASE(frame.m_begin, 0);
|
|
|
DX_RELEASE(frame.m_end, 0);
|
|
|
}
|
|
|
}
|
|
|
@@ -4506,7 +4506,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|
|
|
|
|
Frame& frame = m_frame[m_control.m_current];
|
|
|
deviceCtx->Begin(frame.m_disjoint);
|
|
|
- deviceCtx->End(frame.m_start);
|
|
|
+ deviceCtx->End(frame.m_begin);
|
|
|
}
|
|
|
|
|
|
void TimerQueryD3D11::end()
|
|
|
@@ -4525,8 +4525,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|
|
ID3D11DeviceContext* deviceCtx = s_renderD3D11->m_deviceCtx;
|
|
|
Frame& frame = m_frame[m_control.m_read];
|
|
|
|
|
|
- uint64_t finish;
|
|
|
- HRESULT hr = deviceCtx->GetData(frame.m_end, &finish, sizeof(finish), D3D11_ASYNC_GETDATA_DONOTFLUSH);
|
|
|
+ uint64_t timeEnd;
|
|
|
+ HRESULT hr = deviceCtx->GetData(frame.m_end, &timeEnd, sizeof(timeEnd), D3D11_ASYNC_GETDATA_DONOTFLUSH);
|
|
|
if (S_OK == hr)
|
|
|
{
|
|
|
m_control.consume(1);
|
|
|
@@ -4540,11 +4540,13 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|
|
D3D11_QUERY_DATA_TIMESTAMP_DISJOINT disjoint;
|
|
|
deviceCtx->GetData(frame.m_disjoint, &disjoint, sizeof(disjoint), 0);
|
|
|
|
|
|
- uint64_t start;
|
|
|
- deviceCtx->GetData(frame.m_start, &start, sizeof(start), 0);
|
|
|
+ uint64_t timeBegin;
|
|
|
+ deviceCtx->GetData(frame.m_begin, &timeBegin, sizeof(timeBegin), 0);
|
|
|
|
|
|
m_frequency = disjoint.Frequency;
|
|
|
- m_elapsed = finish - start;
|
|
|
+ m_begin = timeBegin;
|
|
|
+ m_end = timeEnd;
|
|
|
+ m_elapsed = timeEnd - timeBegin;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
@@ -5505,6 +5507,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|
|
elapsed += now;
|
|
|
|
|
|
static int64_t last = now;
|
|
|
+
|
|
|
+ Stats& perfStats = _render->m_perfStats;
|
|
|
+ perfStats.cpuTimeBegin = last;
|
|
|
+
|
|
|
int64_t frameTime = now - last;
|
|
|
last = now;
|
|
|
|
|
|
@@ -5529,10 +5535,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|
|
|
|
|
const int64_t timerFreq = bx::getHPFrequency();
|
|
|
|
|
|
- Stats& perfStats = _render->m_perfStats;
|
|
|
- perfStats.cpuTime = frameTime;
|
|
|
+ perfStats.cpuTimeEnd = now;
|
|
|
perfStats.cpuTimerFreq = timerFreq;
|
|
|
- perfStats.gpuTime = m_gpuTimer.m_elapsed;
|
|
|
+ perfStats.gpuTimeBegin = m_gpuTimer.m_begin;
|
|
|
+ perfStats.gpuTimeEnd = m_gpuTimer.m_end;
|
|
|
perfStats.gpuTimerFreq = m_gpuTimer.m_frequency;
|
|
|
|
|
|
if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
|