Bug 1820066 [1/3] - Fix `CreateSwapChainForHwnd` call r=sotaro

Per Microsoft documentation, DXGI_SCALING_NONE is only supported by
swap chains using DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; for any other swap
effect, including DXGI_SWAP_EFFECT_SEQUENTIAL, another value must be
supplied. Prior to Windows 10 the only such available entry was
DXGI_SCALING_STRETCH, so use that.

This causes the `CreateSwapChainForHwnd` call to succeed, rather than
causing us to fall back to `CreateSwapChain`. There is no known user-
facing effect here, as DXGI_SCALING_STRETCH is documented to be the
semantics applied by `CreateSwapChain` -- but it does eliminate an error
message from the D3D11 debug layer's output.

Differential Revision: https://phabricator.services.mozilla.com/D171521
This commit is contained in:
Ray Kraesig 2023-03-22 15:09:24 +00:00
Родитель 420d6154ec
Коммит 0fe41b776a
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -263,11 +263,12 @@ bool RenderCompositorANGLE::CreateSwapChain(nsACString& aError) {
desc.BufferCount = 2;
}
desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
desc.Scaling = DXGI_SCALING_NONE;
} else {
desc.BufferCount = 1;
desc.SwapEffect = DXGI_SWAP_EFFECT_SEQUENTIAL;
desc.Scaling = DXGI_SCALING_STRETCH;
}
desc.Scaling = DXGI_SCALING_NONE;
desc.Flags = 0;
hr = dxgiFactory2->CreateSwapChainForHwnd(