From c88170966f1d10575ce476896524899dcc909ac5 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 12 Apr 2018 01:15:40 +0200 Subject: [PATCH] [dxgi] Remove gamma control methods from DxgiOutput --- src/dxgi/dxgi_output.cpp | 37 ++++++------------------------------- src/dxgi/dxgi_output.h | 9 --------- src/dxgi/dxgi_swapchain.cpp | 12 +----------- 3 files changed, 7 insertions(+), 51 deletions(-) diff --git a/src/dxgi/dxgi_output.cpp b/src/dxgi/dxgi_output.cpp index 45ee8980..c2ac16a3 100644 --- a/src/dxgi/dxgi_output.cpp +++ b/src/dxgi/dxgi_output.cpp @@ -230,20 +230,14 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE DxgiOutput::GetFrameStatistics(DXGI_FRAME_STATISTICS *pStats) { - Com swapChain = GetFullscreenSwapChain(); - - return swapChain != nullptr - ? swapChain->GetFrameStatistics(pStats) - : DXGI_ERROR_NOT_CURRENTLY_AVAILABLE; + Logger::err("DxgiOutput::GetFrameStatistics: Not implemented"); + return E_NOTIMPL; } HRESULT STDMETHODCALLTYPE DxgiOutput::GetGammaControl(DXGI_GAMMA_CONTROL *pArray) { - Com swapChain = GetFullscreenSwapChain(); - - return swapChain != nullptr - ? swapChain->GetGammaControl(pArray) - : DXGI_ERROR_NOT_CURRENTLY_AVAILABLE; + Logger::err("DxgiOutput::GetGammaControl: Not implemented"); + return E_NOTIMPL; } @@ -271,11 +265,8 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE DxgiOutput::SetGammaControl(const DXGI_GAMMA_CONTROL *pArray) { - Com swapChain = GetFullscreenSwapChain(); - - return swapChain != nullptr - ? swapChain->SetGammaControl(pArray) - : DXGI_ERROR_NOT_CURRENTLY_AVAILABLE; + Logger::err("DxgiOutput::SetGammaControl: Not implemented"); + return E_NOTIMPL; } @@ -293,22 +284,6 @@ namespace dxvk { } - BOOL DxgiOutput::SetSwapChain(DxgiSwapChain* pExpected, DxgiSwapChain* pDesired) { - std::lock_guard lock(m_mutex); - - if (m_fullscreenSwapChain == pExpected) { - m_fullscreenSwapChain = pDesired; - return TRUE; - } return FALSE; - } - - - Com DxgiOutput::GetFullscreenSwapChain() { - std::lock_guard lock(m_mutex); - return Com(m_fullscreenSwapChain); - } - - uint32_t DxgiOutput::GetFormatBpp(DXGI_FORMAT Format) const { DxgiFormatInfo formatInfo = m_adapter->LookupFormat(Format, DxgiFormatMode::Any); return imageFormatInfo(formatInfo.format)->elementSize * 8; diff --git a/src/dxgi/dxgi_output.h b/src/dxgi/dxgi_output.h index 6b2f35cc..77e93c65 100644 --- a/src/dxgi/dxgi_output.h +++ b/src/dxgi/dxgi_output.h @@ -67,20 +67,11 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE WaitForVBlank() final; - BOOL SetSwapChain( - DxgiSwapChain* pExpected, - DxgiSwapChain* pDesired); - private: DxgiAdapter* m_adapter = nullptr; HMONITOR m_monitor = nullptr; - std::mutex m_mutex; - DxgiSwapChain* m_fullscreenSwapChain = nullptr; - - Com GetFullscreenSwapChain(); - uint32_t GetFormatBpp(DXGI_FORMAT Format) const; }; diff --git a/src/dxgi/dxgi_swapchain.cpp b/src/dxgi/dxgi_swapchain.cpp index ced136d3..87d639ff 100644 --- a/src/dxgi/dxgi_swapchain.cpp +++ b/src/dxgi/dxgi_swapchain.cpp @@ -59,8 +59,7 @@ namespace dxvk { DxgiSwapChain::~DxgiSwapChain() { - if (m_output != nullptr) - m_output->SetSwapChain(this, nullptr); + } @@ -428,9 +427,6 @@ namespace dxvk { ::SetWindowPos(m_desc.OutputWindow, HWND_TOPMOST, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOACTIVATE); - - // Assign this swap chain to the output - m_output->SetSwapChain(nullptr, this); return S_OK; } @@ -438,12 +434,6 @@ namespace dxvk { HRESULT DxgiSwapChain::LeaveFullscreenMode() { m_desc.Windowed = TRUE; - // Remove this swap chain from the output - if (m_output != nullptr) { - m_output->SetSwapChain(this, nullptr); - m_output = nullptr; - } - // FIXME wine only restores window flags if the application // has not modified them in the meantime. Some applications // may rely on that behaviour.