Commit 98b053a5 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

d3d9: Update presentation parameters when creating a swap chain.

Fixes regression introduced by 215a32d6. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56070
parent 059b3ac7
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
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