1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[d3d11] Select sync event based on back buffer count

May improve frame pacing in some games.
This commit is contained in:
Philip Rebohle 2019-04-23 16:51:50 +02:00
parent 4cc35da3b2
commit 81f6ccb1be
3 changed files with 8 additions and 3 deletions

View File

@ -1985,8 +1985,12 @@ namespace dxvk {
}
Rc<DxvkEvent> STDMETHODCALLTYPE D3D11DXGIDevice::GetFrameSyncEvent() {
Rc<DxvkEvent> STDMETHODCALLTYPE D3D11DXGIDevice::GetFrameSyncEvent(UINT BufferCount) {
uint32_t frameLatency = m_frameLatency;
if (BufferCount != 0
&& BufferCount <= frameLatency)
frameLatency = BufferCount;
if (m_frameLatencyCap != 0
&& m_frameLatencyCap <= frameLatency)

View File

@ -500,7 +500,8 @@ namespace dxvk {
void STDMETHODCALLTYPE Trim() final;
Rc<DxvkEvent> STDMETHODCALLTYPE GetFrameSyncEvent();
Rc<DxvkEvent> STDMETHODCALLTYPE GetFrameSyncEvent(
UINT BufferCount);
Rc<DxvkDevice> STDMETHODCALLTYPE GetDXVKDevice();

View File

@ -200,7 +200,7 @@ namespace dxvk {
void D3D11SwapChain::PresentImage(UINT SyncInterval) {
// Wait for the sync event so that we
// respect the maximum frame latency
Rc<DxvkEvent> syncEvent = m_dxgiDevice->GetFrameSyncEvent();
Rc<DxvkEvent> syncEvent = m_dxgiDevice->GetFrameSyncEvent(m_desc.BufferCount);
syncEvent->wait();
if (m_hud != nullptr)