From c9c3bc12cca4817abb6a7ff5ab5d98f42433366c Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 12 Apr 2018 01:48:57 +0200 Subject: [PATCH] Revert "[dxgi] Create persistent DxgiOutput object" This reverts commit ad7f0971cf5ba5ed6dc3ace88badc9fcc9ba7504. Causes crashes in Overwatch due to weird refcount behaviour. --- src/dxgi/dxgi_adapter.cpp | 16 ++++++---------- src/dxgi/dxgi_adapter.h | 3 --- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/dxgi/dxgi_adapter.cpp b/src/dxgi/dxgi_adapter.cpp index 593aaee86..ab659addd 100644 --- a/src/dxgi/dxgi_adapter.cpp +++ b/src/dxgi/dxgi_adapter.cpp @@ -16,7 +16,6 @@ namespace dxvk { const Rc& adapter) : m_factory (factory), m_adapter (adapter) { - SetupOutputs(); SetupFormatTable(); } @@ -65,10 +64,14 @@ namespace dxvk { if (ppOutput == nullptr) return DXGI_ERROR_INVALID_CALL; - if (Output > 0) + if (Output > 0) { + *ppOutput = nullptr; return DXGI_ERROR_NOT_FOUND; + } - *ppOutput = m_output.ref(); + // TODO support multiple monitors + HMONITOR monitor = ::MonitorFromPoint({ 0, 0 }, MONITOR_DEFAULTTOPRIMARY); + *ppOutput = ref(new DxgiOutput(this, monitor)); return S_OK; } @@ -274,13 +277,6 @@ namespace dxvk { } - void DxgiAdapter::SetupOutputs() { - // TODO support multiple monitors - HMONITOR monitor = ::MonitorFromPoint({ 0, 0 }, MONITOR_DEFAULTTOPRIMARY); - m_output = new DxgiOutput(this, monitor); - } - - void DxgiAdapter::SetupFormatTable() { /***********************************************************************************/ /* C O L O R F O R M A T S */ diff --git a/src/dxgi/dxgi_adapter.h b/src/dxgi/dxgi_adapter.h index e8d0aafd6..76f4ecaaa 100644 --- a/src/dxgi/dxgi_adapter.h +++ b/src/dxgi/dxgi_adapter.h @@ -66,7 +66,6 @@ namespace dxvk { using FormatMap = std::unordered_map; Com m_factory; - Com m_output; Rc m_adapter; FormatMap m_colorFormats; @@ -92,8 +91,6 @@ namespace dxvk { VkFormat dstFormat, VkImageAspectFlags srvAspect); - void SetupOutputs(); - void SetupFormatTable(); };