diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 8df643ea1..e0e9142d2 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1909,7 +1909,7 @@ namespace dxvk { m_wineFactory (this, &m_d3d11Device), m_frameLatencyCap(m_d3d11Device.GetOptions()->maxFrameLatency) { for (uint32_t i = 0; i < m_frameEvents.size(); i++) - m_frameEvents[i] = new DxvkEvent(); + m_frameEvents[i] = new sync::Signal(true); } @@ -2102,7 +2102,7 @@ namespace dxvk { } - Rc STDMETHODCALLTYPE D3D11DXGIDevice::GetFrameSyncEvent(UINT BufferCount) { + Rc STDMETHODCALLTYPE D3D11DXGIDevice::GetFrameSyncEvent(UINT BufferCount) { uint32_t frameLatency = m_frameLatency; if (BufferCount != 0 diff --git a/src/d3d11/d3d11_device.h b/src/d3d11/d3d11_device.h index aaaade4e6..ab227696d 100644 --- a/src/d3d11/d3d11_device.h +++ b/src/d3d11/d3d11_device.h @@ -530,7 +530,7 @@ namespace dxvk { void STDMETHODCALLTYPE Trim() final; - Rc STDMETHODCALLTYPE GetFrameSyncEvent( + Rc STDMETHODCALLTYPE GetFrameSyncEvent( UINT BufferCount); Rc STDMETHODCALLTYPE GetDXVKDevice(); @@ -552,7 +552,7 @@ namespace dxvk { uint32_t m_frameLatency = DefaultFrameLatency; uint32_t m_frameId = 0; - std::array, 16> m_frameEvents; + std::array, 16> m_frameEvents; Rc CreateDevice(D3D_FEATURE_LEVEL FeatureLevel); diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index 405539c1d..d5b2110b8 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -196,7 +196,7 @@ namespace dxvk { void D3D11SwapChain::PresentImage(UINT SyncInterval) { // Wait for the sync event so that we respect the maximum frame latency - Rc syncEvent = m_dxgiDevice->GetFrameSyncEvent(m_desc.BufferCount); + auto syncEvent = m_dxgiDevice->GetFrameSyncEvent(m_desc.BufferCount); syncEvent->wait(); if (m_hud != nullptr) @@ -298,12 +298,8 @@ namespace dxvk { if (m_hud != nullptr) m_hud->render(m_context, info.imageExtent); - if (i + 1 >= SyncInterval) { - DxvkEventRevision eventRev; - eventRev.event = syncEvent; - eventRev.revision = syncEvent->reset(); - m_context->signalEvent(eventRev); - } + if (i + 1 >= SyncInterval) + m_context->queueSignal(syncEvent); m_device->submitCommandList( m_context->endRecording(),