From 4c222ec557ec2f183fb545ad3ab3bc79ec13a1f9 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 2 Aug 2021 19:10:48 +0200 Subject: [PATCH] [d3d11] Use callback fence to signal Flush1 event --- src/d3d11/d3d11_context_imm.cpp | 6 ++++-- src/d3d11/d3d11_context_imm.h | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index fbfaca9e..307110da 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -596,9 +596,11 @@ namespace dxvk { uint64_t value = ++m_eventCount; if (m_eventSignal == nullptr) - m_eventSignal = new sync::Win32Fence(); + m_eventSignal = new sync::CallbackFence(); - m_eventSignal->setEvent(hEvent, value); + m_eventSignal->setCallback(value, [hEvent] { + SetEvent(hEvent); + }); EmitCs([ cSignal = m_eventSignal, diff --git a/src/d3d11/d3d11_context_imm.h b/src/d3d11/d3d11_context_imm.h index e23fe2b4..ae57cfb1 100644 --- a/src/d3d11/d3d11_context_imm.h +++ b/src/d3d11/d3d11_context_imm.h @@ -2,7 +2,7 @@ #include "../util/util_time.h" -#include "../util/sync/sync_signal_win32.h" +#include "../util/sync/sync_signal.h" #include "d3d11_context.h" #include "d3d11_state_object.h" @@ -118,8 +118,8 @@ namespace dxvk { DxvkCsThread m_csThread; bool m_csIsBusy = false; - Rc m_eventSignal; - uint64_t m_eventCount = 0; + Rc m_eventSignal; + uint64_t m_eventCount = 0; dxvk::high_resolution_clock::time_point m_lastFlush = dxvk::high_resolution_clock::now();