[d3d11] Fix immediate context reference counting

Fixes various wine test failures.
This commit is contained in:
Philip Rebohle 2019-10-14 01:56:34 +02:00
parent 4d0cc3e24e
commit 1282c2b99e
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 10 additions and 2 deletions

View File

@ -36,12 +36,18 @@ namespace dxvk {
ULONG STDMETHODCALLTYPE D3D11ImmediateContext::AddRef() {
return m_parent->AddRef();
ULONG refCount = m_refCount++;
if (!refCount)
m_parent->AddRef();
return refCount;
}
ULONG STDMETHODCALLTYPE D3D11ImmediateContext::Release() {
return m_parent->Release();
ULONG refCount = --m_refCount;
if (!refCount)
m_parent->Release();
return refCount;
}

View File

@ -109,6 +109,8 @@ namespace dxvk {
DxvkCsThread m_csThread;
bool m_csIsBusy = false;
std::atomic<uint32_t> m_refCount = { 0 };
std::chrono::high_resolution_clock::time_point m_lastFlush
= std::chrono::high_resolution_clock::now();