[dxgi] Duplicate frame latency handle

Apps can call CloseHandle on this.
This commit is contained in:
Philip Rebohle 2022-09-01 16:36:47 +02:00 committed by Philip Rebohle
parent 11ef172c79
commit 17320776f0
2 changed files with 14 additions and 1 deletions

View File

@ -115,7 +115,18 @@ namespace dxvk {
HANDLE STDMETHODCALLTYPE D3D11SwapChain::GetFrameLatencyEvent() {
return m_frameLatencyEvent;
HANDLE result = nullptr;
if (!m_processHandle)
m_processHandle = GetCurrentProcess();
if (!DuplicateHandle(m_processHandle, m_frameLatencyEvent,
m_processHandle, &result, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
Logger::err("DxgiSwapChain::GetFrameLatencyWaitableObject: DuplicateHandle failed");
return nullptr;
}
return result;
}

View File

@ -109,6 +109,8 @@ namespace dxvk {
HANDLE m_frameLatencyEvent = nullptr;
Rc<sync::CallbackFence> m_frameLatencySignal;
HANDLE m_processHandle = nullptr;
bool m_dirty = true;
bool m_vsync = true;