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:
parent
4cc35da3b2
commit
81f6ccb1be
@ -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)
|
||||
|
@ -500,7 +500,8 @@ namespace dxvk {
|
||||
|
||||
void STDMETHODCALLTYPE Trim() final;
|
||||
|
||||
Rc<DxvkEvent> STDMETHODCALLTYPE GetFrameSyncEvent();
|
||||
Rc<DxvkEvent> STDMETHODCALLTYPE GetFrameSyncEvent(
|
||||
UINT BufferCount);
|
||||
|
||||
Rc<DxvkDevice> STDMETHODCALLTYPE GetDXVKDevice();
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user