[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:
Philip Rebohle 2023-06-24 12:35:31 +02:00
parent 3b3ebc9350
commit a7278cdab1
2 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -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 };