mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 19:24:10 +01:00
[d3d11] Fix immediate context reference counting
Fixes various wine test failures.
This commit is contained in:
parent
4d0cc3e24e
commit
1282c2b99e
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user