mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
d3d12: Measure flip duration
This commit is contained in:
parent
442abcc6f1
commit
6b0d29a72d
@ -836,6 +836,10 @@ void D3D12GSRender::Flip()
|
||||
if(Ini.GSOverlay.GetValue())
|
||||
renderOverlay();
|
||||
|
||||
ResetTimer();
|
||||
|
||||
std::chrono::time_point<std::chrono::system_clock> flipStart = std::chrono::system_clock::now();
|
||||
|
||||
ThrowIfFailed(m_swapChain->Present(Ini.GSVSyncEnable.GetValue() ? 1 : 0, 0));
|
||||
// Add an event signaling queue completion
|
||||
|
||||
@ -874,7 +878,9 @@ void D3D12GSRender::Flip()
|
||||
|
||||
m_frame->Flip(nullptr);
|
||||
|
||||
ResetTimer();
|
||||
|
||||
std::chrono::time_point<std::chrono::system_clock> flipEnd = std::chrono::system_clock::now();
|
||||
m_timers.m_flipDuration += std::chrono::duration_cast<std::chrono::microseconds>(flipEnd - flipStart).count();
|
||||
}
|
||||
|
||||
void D3D12GSRender::ResetTimer()
|
||||
@ -887,6 +893,7 @@ void D3D12GSRender::ResetTimer()
|
||||
m_timers.m_programLoadDuration = 0;
|
||||
m_timers.m_constantsDuration = 0;
|
||||
m_timers.m_textureDuration = 0;
|
||||
m_timers.m_flipDuration = 0;
|
||||
}
|
||||
|
||||
D3D12GSRender::ResourceStorage& D3D12GSRender::getCurrentResourceStorage()
|
||||
|
@ -244,6 +244,7 @@ private:
|
||||
size_t m_programLoadDuration;
|
||||
size_t m_constantsDuration;
|
||||
size_t m_textureDuration;
|
||||
size_t m_flipDuration;
|
||||
} m_timers;
|
||||
|
||||
void ResetTimer();
|
||||
|
@ -130,6 +130,7 @@ void D3D12GSRender::renderOverlay()
|
||||
std::wstring constantDuration = L"Constants : " + std::to_wstring(m_timers.m_constantsDuration) + L" us (" + std::to_wstring(100.f * constantsPercent) + L" %)";
|
||||
float rttPercent = (float)m_timers.m_rttDuration / (float)m_timers.m_drawCallDuration;
|
||||
std::wstring rttDuration = L"RTT : " + std::to_wstring(m_timers.m_rttDuration) + L" us (" + std::to_wstring(100.f * rttPercent) + L" %)";
|
||||
std::wstring flipDuration = L"Flip : " + std::to_wstring(m_timers.m_flipDuration) + L" us";
|
||||
|
||||
std::wstring count = L"Draw count : " + std::to_wstring(m_timers.m_drawCallCount);
|
||||
|
||||
@ -196,6 +197,13 @@ void D3D12GSRender::renderOverlay()
|
||||
&D2D1::RectF(0, 98, rtSize.width, rtSize.height),
|
||||
m_textBrush.Get()
|
||||
);
|
||||
m_d2dDeviceContext->DrawTextW(
|
||||
flipDuration.c_str(),
|
||||
(UINT32)flipDuration.size(),
|
||||
m_textFormat.Get(),
|
||||
&D2D1::RectF(0, 112, rtSize.width, rtSize.height),
|
||||
m_textBrush.Get()
|
||||
);
|
||||
m_d2dDeviceContext->EndDraw();
|
||||
|
||||
// Release our wrapped render target resource. Releasing
|
||||
|
Loading…
Reference in New Issue
Block a user