From 0508cb848fd9d981715c54409dd282cc4fd3638e Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 24 Oct 2019 13:43:05 -0500 Subject: [PATCH] d3d8: 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/d3d8/device.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 53e92707ca3..63bf5f4fa27 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -909,13 +909,15 @@ static HRESULT WINAPI d3d8_device_Reset(IDirect3DDevice8 *iface, device->index_buffer_size = 0; } + if (device->recording) + wined3d_stateblock_decref(device->recording); + device->recording = NULL; + device->update_state = device->state; + wined3d_stateblock_reset(device->state); + if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc, NULL, reset_enum_callback, TRUE))) { - if (device->recording) - wined3d_stateblock_decref(device->recording); - device->recording = NULL; - device->update_state = device->state; present_parameters->BackBufferCount = swapchain_desc.backbuffer_count; implicit_swapchain = wined3d_swapchain_get_parent(device->implicit_swapchain); implicit_swapchain->swap_interval