d3d9: Update presentation parameters when creating a swap chain.

Fixes regression introduced by 215a32d643.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56070
This commit is contained in:
Akihiro Sagawa 2024-01-08 18:02:55 +09:00 committed by Alexandre Julliard
parent 059b3ac77f
commit 98b053a5b8
3 changed files with 14 additions and 8 deletions

View file

@ -370,6 +370,7 @@ static const struct wined3d_swapchain_state_parent_ops d3d9_swapchain_state_pare
static HRESULT swapchain_init(struct d3d9_swapchain *swapchain, struct d3d9_device *device,
struct wined3d_swapchain_desc *desc, unsigned int swap_interval)
{
struct wined3d_swapchain_desc swapchain_desc;
HRESULT hr;
swapchain->refcount = 1;
@ -384,6 +385,11 @@ static HRESULT swapchain_init(struct d3d9_swapchain *swapchain, struct d3d9_devi
return hr;
}
wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &swapchain_desc);
desc->backbuffer_width = swapchain_desc.backbuffer_width;
desc->backbuffer_height = swapchain_desc.backbuffer_height;
desc->backbuffer_format = swapchain_desc.backbuffer_format;
swapchain->parent_device = &device->IDirect3DDevice9Ex_iface;
IDirect3DDevice9Ex_AddRef(swapchain->parent_device);

View file

@ -3851,11 +3851,11 @@ static void test_swapchain_parameters(void)
window, D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&present_parameters, NULL, &device);
todo_wine ok(present_parameters.BackBufferWidth == client_rect.right, "Got unexpected BackBufferWidth %u, expected %ld.\n",
ok(present_parameters.BackBufferWidth == client_rect.right, "Got unexpected BackBufferWidth %u, expected %ld.\n",
present_parameters.BackBufferWidth, client_rect.right);
todo_wine ok(present_parameters.BackBufferHeight == client_rect.bottom, "Got unexpected BackBufferHeight %u, expected %ld.\n",
ok(present_parameters.BackBufferHeight == client_rect.bottom, "Got unexpected BackBufferHeight %u, expected %ld.\n",
present_parameters.BackBufferHeight, client_rect.bottom);
todo_wine ok(present_parameters.BackBufferFormat != D3DFMT_UNKNOWN, "Got unexpected BackBufferFormat %#x.\n",
ok(present_parameters.BackBufferFormat != D3DFMT_UNKNOWN, "Got unexpected BackBufferFormat %#x.\n",
present_parameters.BackBufferFormat);
ok(present_parameters.BackBufferCount == 1, "Got unexpected BackBufferCount %u.\n", present_parameters.BackBufferCount);
ok(!present_parameters.MultiSampleType, "Got unexpected MultiSampleType %u.\n", present_parameters.MultiSampleType);

View file

@ -1352,9 +1352,9 @@ static void test_swapchain(void)
d3dpp.BackBufferCount = 0;
hr = IDirect3DDevice9_CreateAdditionalSwapChain(device, &d3dpp, &swapchain1);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
todo_wine ok(d3dpp.BackBufferWidth == client_rect.right, "Got unexpected BackBufferWidth %u, expected %ld.\n",
ok(d3dpp.BackBufferWidth == client_rect.right, "Got unexpected BackBufferWidth %u, expected %ld.\n",
d3dpp.BackBufferWidth, client_rect.right);
todo_wine ok(d3dpp.BackBufferHeight == client_rect.bottom, "Got unexpected BackBufferHeight %u, expected %ld.\n",
ok(d3dpp.BackBufferHeight == client_rect.bottom, "Got unexpected BackBufferHeight %u, expected %ld.\n",
d3dpp.BackBufferHeight, client_rect.bottom);
ok(d3dpp.BackBufferFormat == D3DFMT_A8R8G8B8, "Got unexpected BackBufferFormat %#x.\n", d3dpp.BackBufferFormat);
ok(d3dpp.BackBufferCount == 1, "Got unexpected BackBufferCount %u.\n", d3dpp.BackBufferCount);
@ -12521,11 +12521,11 @@ static void test_swapchain_parameters(void)
&present_parameters, &device);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(present_parameters.BackBufferWidth == client_rect.right, "Got unexpected BackBufferWidth %u, expected %ld.\n",
ok(present_parameters.BackBufferWidth == client_rect.right, "Got unexpected BackBufferWidth %u, expected %ld.\n",
present_parameters.BackBufferWidth, client_rect.right);
todo_wine ok(present_parameters.BackBufferHeight == client_rect.bottom, "Got unexpected BackBufferHeight %u, expected %ld.\n",
ok(present_parameters.BackBufferHeight == client_rect.bottom, "Got unexpected BackBufferHeight %u, expected %ld.\n",
present_parameters.BackBufferHeight, client_rect.bottom);
todo_wine ok(present_parameters.BackBufferFormat != D3DFMT_UNKNOWN, "Got unexpected BackBufferFormat %#x.\n",
ok(present_parameters.BackBufferFormat != D3DFMT_UNKNOWN, "Got unexpected BackBufferFormat %#x.\n",
present_parameters.BackBufferFormat);
ok(present_parameters.BackBufferCount == 1, "Got unexpected BackBufferCount %u.\n", present_parameters.BackBufferCount);
ok(!present_parameters.MultiSampleType, "Got unexpected MultiSampleType %u.\n", present_parameters.MultiSampleType);