From 6c51a93b6378ed1ab0a8bcbc044d4f87bdfdac0b Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 24 Oct 2019 13:43:06 -0500 Subject: [PATCH] ddraw: Reset the stateblock state before calling wined3d_device_reset(). Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/ddraw/surface.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 769b5a75769..89e5024c0ef 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -6068,14 +6068,6 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ swapchain_desc.backbuffer_height = mode.height; swapchain_desc.backbuffer_format = mode.format_id; - if (FAILED(hr = wined3d_device_reset(ddraw->wined3d_device, - &swapchain_desc, NULL, ddraw_reset_enum_callback, TRUE))) - { - ERR("Failed to reset device.\n"); - heap_free(texture); - return hr_ddraw_from_wined3d(hr); - } - if (ddraw->d3ddevice) { if (ddraw->d3ddevice->recording) @@ -6083,6 +6075,15 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ ddraw->d3ddevice->recording = NULL; ddraw->d3ddevice->update_state = ddraw->d3ddevice->state; } + wined3d_stateblock_reset(ddraw->state); + + if (FAILED(hr = wined3d_device_reset(ddraw->wined3d_device, + &swapchain_desc, NULL, ddraw_reset_enum_callback, TRUE))) + { + ERR("Failed to reset device.\n"); + heap_free(texture); + return hr_ddraw_from_wined3d(hr); + } wined3d_device_set_render_state(ddraw->wined3d_device, WINED3D_RS_ZENABLE, !!swapchain_desc.enable_auto_depth_stencil);