1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-24 08:33:34 +00:00

vo_gpu: d3d11_helpers: don't create UNORDERED_ACCESS backbuffers in Win7

We're getting bug reports that the recent change to add extra usage
flags to swapchain buffers (for gpu-next) breaks mpv on some Windows 7
systems, and it seems like this is only happening with flip-model
swapchains.

Creating swapchains with DXGI_USAGE_UNORDERED_ACCESS should be valid. At
least, it's not specifically disallowed, unlike some other flags[1]. So,
just disable it for flip-model swapchains in Windows 7, rather than
disabling it everywhere.

[1]: https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-usage
This commit is contained in:
James Ross-Gowan 2022-02-08 22:17:19 +11:00 committed by Jan Ekström
parent f9bf6a601c
commit 4629fe577f

View File

@ -630,6 +630,16 @@ static HRESULT create_swapchain_1_2(ID3D11Device *dev, IDXGIFactory2 *factory,
};
if (flip) {
// UNORDERED_ACCESS with FLIP_SEQUENTIAL seems to be buggy with
// Windows 7 drivers
if ((desc.BufferUsage & DXGI_USAGE_UNORDERED_ACCESS) &&
!IsWindows8OrGreater())
{
mp_verbose(log, "Disabling UNORDERED_ACCESS for flip-model "
"swapchain backbuffers in Windows 7\n");
desc.BufferUsage &= ~DXGI_USAGE_UNORDERED_ACCESS;
}
desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
desc.BufferCount = opts->length;
} else {