diff options
author | thexai <58434170+thexai@users.noreply.github.com> | 2023-09-15 15:32:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-15 15:32:21 +0200 |
commit | a8bc2dccde850262f6aff3411430d9d11afcc313 (patch) | |
tree | 2f0c9aab8343cfae77e23cb64a14504cf745bc6a | |
parent | a26677f0f355a84d5d6cac192d219abb72664253 (diff) | |
parent | 87ebcbebabd1441e86a5cbe5b80686f822d79da7 (diff) |
Merge pull request #23766 from thexai/fix-refresh-rate
[Windows] Fix 24Hz refresh rate when HDR is ON on AMD systems
-rw-r--r-- | xbmc/rendering/dx/DeviceResources.cpp | 20 | ||||
-rw-r--r-- | xbmc/rendering/dx/DeviceResources.h | 1 |
2 files changed, 0 insertions, 21 deletions
diff --git a/xbmc/rendering/dx/DeviceResources.cpp b/xbmc/rendering/dx/DeviceResources.cpp index 8cfe5cf62c..103809d591 100644 --- a/xbmc/rendering/dx/DeviceResources.cpp +++ b/xbmc/rendering/dx/DeviceResources.cpp @@ -729,7 +729,6 @@ void DX::DeviceResources::ResizeBuffers() ComPtr<IDXGIDevice1> dxgiDevice; hr = m_d3dDevice.As(&dxgiDevice); CHECK_ERR(); dxgiDevice->SetMaximumFrameLatency(1); - m_usedSwapChain = false; if (m_IsHDROutput) SetHdrColorSpace(DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020); @@ -960,7 +959,6 @@ void DX::DeviceResources::HandleDeviceLost(bool removed) bool DX::DeviceResources::Begin() { HRESULT hr = m_swapChain->Present(0, DXGI_PRESENT_TEST); - m_usedSwapChain = true; // If the device was removed either by a disconnection or a driver upgrade, we // must recreate all device resources. @@ -992,7 +990,6 @@ void DX::DeviceResources::Present() // frames that will never be displayed to the screen. DXGI_PRESENT_PARAMETERS parameters = {}; HRESULT hr = m_swapChain->Present1(1, 0, ¶meters); - m_usedSwapChain = true; // If the device was removed either by a disconnection or a driver upgrade, we // must recreate all device resources. @@ -1311,23 +1308,6 @@ void DX::DeviceResources::SetHdrColorSpace(const DXGI_COLOR_SPACE_TYPE colorSpac if (SUCCEEDED(m_swapChain.As(&swapChain3))) { - // Set the color space on a new swap chain - not mandated by MS documentation but needed - // at least for some AMD on Windows 10, at least up to driver 31.0.21001.45002 - // Applying to AMD only because it breaks refresh rate switching in Windows 11 for Intel and - // nVidia and they don't need the workaround. - if (m_usedSwapChain && - m_IsTransferPQ != (colorSpace == DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020)) - { - if (GetAdapterDesc().VendorId == PCIV_AMD) - { - // Temporary release, can't hold references during swap chain re-creation - swapChain3 = nullptr; - DestroySwapChain(); - CreateWindowSizeDependentResources(); - m_swapChain.As(&swapChain3); - } - } - if (SUCCEEDED(swapChain3->SetColorSpace1(colorSpace))) { m_IsTransferPQ = (colorSpace == DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020); diff --git a/xbmc/rendering/dx/DeviceResources.h b/xbmc/rendering/dx/DeviceResources.h index 01fa76a659..8d325ee6dc 100644 --- a/xbmc/rendering/dx/DeviceResources.h +++ b/xbmc/rendering/dx/DeviceResources.h @@ -188,7 +188,6 @@ namespace DX bool m_NV12SharedTexturesSupport{false}; bool m_DXVA2SharedDecoderSurfaces{false}; bool m_DXVASuperResolutionSupport{false}; - bool m_usedSwapChain{false}; bool m_DXVA2UseFence{false}; }; } |