1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-15 07:29:17 +01:00

[dxgi] Remove gamma control methods from DxgiOutput

This commit is contained in:
Philip Rebohle 2018-04-12 01:15:40 +02:00
parent 015e67fc7c
commit c88170966f
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 7 additions and 51 deletions

View File

@ -230,20 +230,14 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE DxgiOutput::GetFrameStatistics(DXGI_FRAME_STATISTICS *pStats) {
Com<DxgiSwapChain> 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<DxgiSwapChain> 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<DxgiSwapChain> 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<std::mutex> lock(m_mutex);
if (m_fullscreenSwapChain == pExpected) {
m_fullscreenSwapChain = pDesired;
return TRUE;
} return FALSE;
}
Com<DxgiSwapChain> DxgiOutput::GetFullscreenSwapChain() {
std::lock_guard<std::mutex> lock(m_mutex);
return Com<DxgiSwapChain>(m_fullscreenSwapChain);
}
uint32_t DxgiOutput::GetFormatBpp(DXGI_FORMAT Format) const {
DxgiFormatInfo formatInfo = m_adapter->LookupFormat(Format, DxgiFormatMode::Any);
return imageFormatInfo(formatInfo.format)->elementSize * 8;

View File

@ -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<DxgiSwapChain> GetFullscreenSwapChain();
uint32_t GetFormatBpp(DXGI_FORMAT Format) const;
};

View File

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