Module: wine Branch: master Commit: 98b053a5b8dcdfe2e3481a36cc156e71e2d5145e URL: https://gitlab.winehq.org/wine/wine/-/commit/98b053a5b8dcdfe2e3481a36cc156e7...
Author: Akihiro Sagawa sagawa.aki@gmail.com Date: Mon Jan 8 18:02:55 2024 +0900
d3d9: Update presentation parameters when creating a swap chain.
Fixes regression introduced by 215a32d643af4a8e25d4f28c5bec76f6e69dca22.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56070
---
dlls/d3d9/swapchain.c | 6 ++++++ dlls/d3d9/tests/d3d9ex.c | 6 +++--- dlls/d3d9/tests/device.c | 10 +++++----- 3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d9/swapchain.c b/dlls/d3d9/swapchain.c index 26c47f2c6ec..e87b8627ba3 100644 --- a/dlls/d3d9/swapchain.c +++ b/dlls/d3d9/swapchain.c @@ -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);
diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 44d5edba63c..8e7eec13566 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -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); diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 5c08d35c93f..9d92b248dd9 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -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);