mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-04 16:24:29 +01:00
[dxgi] Do not interact with other DXGI objects during swapchain destruction
This trips up Stalker Anomaly for some reason, but initializing an output is not meaningful anyway in this situation since we either know the output in question already, or we don't and it cannot be in a non-default state. Closes #3531.
This commit is contained in:
parent
3b3ebc9350
commit
a7278cdab1
@ -838,7 +838,7 @@ namespace dxvk {
|
||||
|
||||
HRESULT hr = m_monitorInfo->AcquireMonitorData(hMonitor, ppData);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
if (FAILED(hr) && HasLiveReferences()) {
|
||||
// We may need to initialize a DXGI output to populate monitor data.
|
||||
// If acquiring monitor data has failed previously, do not try again.
|
||||
if (hMonitor == m_monitor && !m_monitorHasOutput)
|
||||
|
@ -68,10 +68,14 @@ namespace dxvk {
|
||||
}
|
||||
}
|
||||
|
||||
ULONG GetPrivateRefCount() {
|
||||
ULONG GetPrivateRefCount() const {
|
||||
return m_refPrivate.load();
|
||||
}
|
||||
|
||||
|
||||
bool HasLiveReferences() const {
|
||||
return bool(m_refCount.load() | m_refPrivate.load());
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
std::atomic<uint32_t> m_refCount = { 0ul };
|
||||
|
Loading…
Reference in New Issue
Block a user