[d3d11] Support signaling event in Flush1

This commit is contained in:
Philip Rebohle 2020-03-19 23:29:32 +01:00
parent 76fd9013d4
commit a9b6421f60
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 25 additions and 1 deletions

View File

@ -156,7 +156,7 @@ namespace dxvk {
m_parent->FlushInitContext();
if (hEvent)
Logger::warn("D3D11: Flush1: Ignoring event");
SignalEvent(hEvent);
D3D10DeviceLock lock = LockContext();
@ -646,5 +646,22 @@ namespace dxvk {
Flush();
}
}
void D3D11ImmediateContext::SignalEvent(HANDLE hEvent) {
uint64_t value = ++m_eventCount;
if (m_eventSignal == nullptr)
m_eventSignal = new sync::Win32Fence();
m_eventSignal->setEvent(hEvent, value);
EmitCs([
cSignal = m_eventSignal,
cValue = value
] (DxvkContext* ctx) {
ctx->signal(cSignal, cValue);
});
}
}

View File

@ -2,6 +2,8 @@
#include "../util/util_time.h"
#include "../util/sync/sync_signal_win32.h"
#include "d3d11_context.h"
#include "d3d11_state_object.h"
@ -116,6 +118,9 @@ namespace dxvk {
std::atomic<uint32_t> m_refCount = { 0 };
Rc<sync::Win32Fence> m_eventSignal;
uint64_t m_eventCount = 0;
dxvk::high_resolution_clock::time_point m_lastFlush
= dxvk::high_resolution_clock::now();
@ -148,6 +153,8 @@ namespace dxvk {
void EmitCsChunk(DxvkCsChunkRef&& chunk);
void FlushImplicit(BOOL StrongHint);
void SignalEvent(HANDLE hEvent);
};