From: Conor McCarthy <cmccarthy@codeweavers.com> --- dlls/d3d8/device.c | 3 ++- dlls/d3d8/tests/device.c | 1 - dlls/wined3d/device.c | 7 +++++++ include/wine/wined3d.h | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 036c60edc37..e2abd6e8ff4 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -308,7 +308,8 @@ static BOOL wined3d_swapchain_desc_from_d3d8(struct wined3d_swapchain_desc *swap swapchain_desc->auto_depth_stencil_format = wined3dformat_from_d3dformat(present_parameters->AutoDepthStencilFormat); swapchain_desc->flags - = (present_parameters->Flags & D3DPRESENTFLAGS_MASK) | WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH; + = (present_parameters->Flags & D3DPRESENTFLAGS_MASK) | WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH + | WINED3D_SWAPCHAIN_NO_16_BIT_MULTISAMPLING; swapchain_desc->refresh_rate = present_parameters->FullScreen_RefreshRateInHz; swapchain_desc->auto_restore_display_mode = TRUE; diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index e2c4ae67748..2969bdd45aa 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -9569,7 +9569,6 @@ static void test_swapchain_multisample_reset(void) present_parameters.Windowed = TRUE; present_parameters.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES; hr = IDirect3DDevice8_Reset(device, &present_parameters); - todo_wine_if(formats[i].expected_hr == D3DERR_INVALIDCALL) ok(hr == formats[i].expected_hr, "Unexpected hr %#lx.\n", hr); if (FAILED(hr)) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e754cc633b7..23cd94c6c23 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5082,6 +5082,13 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, TRACE("refresh_rate %u\n", swapchain_desc->refresh_rate); TRACE("auto_restore_display_mode %#x\n", swapchain_desc->auto_restore_display_mode); + /* d3d8 allows the lockable flag even though the backbuffer is not lockable. */ + if (swapchain_desc->flags & WINED3D_SWAPCHAIN_NO_16_BIT_MULTISAMPLING) + { + if (wined3d_get_format(device->adapter, swapchain_desc->backbuffer_format, 0)->byte_count == 2) + 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); diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index cfb098adfb0..e82b078537e 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -920,6 +920,7 @@ enum wined3d_memory_segment_group #define WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES 0x00040000u #define WINED3D_SWAPCHAIN_RESTORE_WINDOW_STATE 0x00080000u #define WINED3D_SWAPCHAIN_REGISTER_TOPMOST_TIMER 0x00100000u +#define WINED3D_SWAPCHAIN_NO_16_BIT_MULTISAMPLING 0x00200000u #define WINED3DDP_MAXTEXCOORD 8 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10874