1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

dxgi: Immediately error out when creating a D3D12 swapchain on a non-immediate queue.

This commit is contained in:
Giovanni Mascellani 2023-02-25 22:32:56 +01:00 committed by Alexandre Julliard
parent 494eec109b
commit e946f610b2
2 changed files with 5 additions and 1 deletions

View File

@ -1474,7 +1474,6 @@ static void test_invalid_command_queue_types(void)
hr = IDXGIFactory_CreateSwapChain(factory, queue_unk, &swapchain_desc, &swapchain);
expected = queue_types[i] == D3D12_COMMAND_LIST_TYPE_DIRECT ? S_OK : DXGI_ERROR_INVALID_CALL;
todo_wine_if(queue_types[i] != D3D12_COMMAND_LIST_TYPE_DIRECT)
ok(hr == expected, "Got unexpected hr %#lx.\n", hr);
if (hr == S_OK)

View File

@ -3071,6 +3071,7 @@ HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *qu
IDXGISwapChain1 **swapchain)
{
DXGI_SWAP_CHAIN_FULLSCREEN_DESC default_fullscreen_desc;
struct D3D12_COMMAND_QUEUE_DESC queue_desc;
struct d3d12_swapchain *object;
ID3D12Device *device;
HRESULT hr;
@ -3078,6 +3079,10 @@ HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *qu
if (swapchain_desc->Format == DXGI_FORMAT_UNKNOWN)
return DXGI_ERROR_INVALID_CALL;
queue_desc = ID3D12CommandQueue_GetDesc(queue);
if (queue_desc.Type != D3D12_COMMAND_LIST_TYPE_DIRECT)
return DXGI_ERROR_INVALID_CALL;
if (!fullscreen_desc)
{
memset(&default_fullscreen_desc, 0, sizeof(default_fullscreen_desc));