aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthexai <58434170+thexai@users.noreply.github.com>2023-09-16 18:28:04 +0200
committerGitHub <noreply@github.com>2023-09-16 18:28:04 +0200
commitb90cc563c16ee5040b122b36d7f00d570178ef03 (patch)
treec5ef47aeb6859cdfeef3e38aab3e653c488442fb
parent58873bba2b10a8c5f567587fe2253b8a2e8b0eec (diff)
parent6f7b14e6d1e475ec1de3eb810eabc91be0cfeb10 (diff)
Merge pull request #23768 from thexai/fix-refresh-rate-Nexus
[Windows] Fix 24Hz refresh rate when HDR is ON on AMD systems
-rw-r--r--xbmc/rendering/dx/DeviceResources.cpp23
-rw-r--r--xbmc/rendering/dx/DeviceResources.h1
2 files changed, 0 insertions, 24 deletions
diff --git a/xbmc/rendering/dx/DeviceResources.cpp b/xbmc/rendering/dx/DeviceResources.cpp
index d1d1d5ea5b..b3ae890f83 100644
--- a/xbmc/rendering/dx/DeviceResources.cpp
+++ b/xbmc/rendering/dx/DeviceResources.cpp
@@ -708,7 +708,6 @@ void DX::DeviceResources::ResizeBuffers()
ComPtr<IDXGIDevice1> dxgiDevice;
hr = m_d3dDevice.As(&dxgiDevice); CHECK_ERR();
dxgiDevice->SetMaximumFrameLatency(1);
- m_usedSwapChain = false;
}
CLog::LogF(LOGDEBUG, "end resize buffers.");
@@ -936,7 +935,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.
@@ -968,7 +966,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, &parameters);
- m_usedSwapChain = true;
// If the device was removed either by a disconnection or a driver upgrade, we
// must recreate all device resources.
@@ -1273,26 +1270,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))
- {
- DXGI_ADAPTER_DESC ad{};
- GetAdapterDesc(&ad);
-
- if (ad.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 2527720cd7..d45890264f 100644
--- a/xbmc/rendering/dx/DeviceResources.h
+++ b/xbmc/rendering/dx/DeviceResources.h
@@ -183,6 +183,5 @@ namespace DX
bool m_IsTransferPQ;
bool m_NV12SharedTexturesSupport{false};
bool m_DXVA2SharedDecoderSurfaces{false};
- bool m_usedSwapChain{false};
};
}