Commit 42b22b0a authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

dxgi: Reject DXGI_FORMAT_UNKNOWN for swapchains.

parent 11dfed9f
......@@ -85,7 +85,7 @@ BOOL dxgi_validate_swapchain_desc(const DXGI_SWAP_CHAIN_DESC1 *desc)
case DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL:
min_buffer_count = 2;
if (!dxgi_validate_flip_swap_effect_format(desc->Format))
if (desc->Format && !dxgi_validate_flip_swap_effect_format(desc->Format))
return FALSE;
if (desc->SampleDesc.Count != 1 || desc->SampleDesc.Quality)
......@@ -738,6 +738,9 @@ HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_devi
*/
if (!implicit)
{
if (desc->backbuffer_format == WINED3DFMT_UNKNOWN)
return E_INVALIDARG;
if (FAILED(hr = IWineDXGIAdapter_GetParent(device->adapter, &IID_IDXGIFactory,
(void **)&swapchain->factory)))
{
......@@ -2604,6 +2607,9 @@ HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *qu
ID3D12Device *device;
HRESULT hr;
if (swapchain_desc->Format == DXGI_FORMAT_UNKNOWN)
return DXGI_ERROR_INVALID_CALL;
if (!fullscreen_desc)
{
memset(&default_fullscreen_desc, 0, sizeof(default_fullscreen_desc));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment