From: Conor McCarthy <cmccarthy@codeweavers.com> --- dlls/d3d8/tests/device.c | 1 - dlls/d3d9/tests/device.c | 2 -- dlls/wined3d/device.c | 6 ++++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 2969bdd45aa..f9bf9d05df8 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -9592,7 +9592,6 @@ static void test_swapchain_multisample_reset(void) /* But locking is not allowed. */ hr = IDirect3DSurface8_LockRect(surface, &lr, NULL, 0); - todo_wine ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); IDirect3DSurface8_Release(surface); diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 3ecd75c4fe3..2302cdc0cbb 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -13292,10 +13292,8 @@ static void test_swapchain_multisample_reset(void) /* Lockable back buffer flag is not allowed. */ d3dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; hr = IDirect3DDevice9_Reset(device, &d3dpp); - todo_wine ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); hr = IDirect3DDevice9_TestCooperativeLevel(device); - todo_wine ok(hr == D3DERR_DEVICENOTRESET, "TestCooperativeLevel returned hr %#lx.\n", hr); refcount = IDirect3DDevice9_Release(device); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 23cd94c6c23..9f5f23b92a3 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5088,6 +5088,10 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (wined3d_get_format(device->adapter, swapchain_desc->backbuffer_format, 0)->byte_count == 2) return WINED3DERR_INVALIDCALL; } + else if (swapchain_desc->multisample_type && (swapchain_desc->flags & WINED3D_SWAPCHAIN_LOCKABLE_BACKBUFFER)) + { + return WINED3DERR_INVALIDCALL; + } if (swapchain_desc->backbuffer_bind_flags && swapchain_desc->backbuffer_bind_flags != WINED3D_BIND_RENDER_TARGET) FIXME("Got unexpected backbuffer bind flags %#x.\n", swapchain_desc->backbuffer_bind_flags); @@ -5176,6 +5180,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (swapchain_desc->flags != current_desc->flags) { current_desc->flags = swapchain_desc->flags; + if (swapchain_desc->multisample_type) + current_desc->flags &= ~WINED3D_SWAPCHAIN_LOCKABLE_BACKBUFFER; update_swapchain_flags(swapchain->front_buffer); for (i = 0; i < current_desc->backbuffer_count; ++i) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10874