d3d8: Reset the stateblock state before calling wined3d_device_reset().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-10-24 13:43:05 -05:00 committed by Alexandre Julliard
parent bb3cc5e05c
commit 0508cb848f
1 changed files with 6 additions and 4 deletions

View File

@ -909,13 +909,15 @@ static HRESULT WINAPI d3d8_device_Reset(IDirect3DDevice8 *iface,
device->index_buffer_size = 0; 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, if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc,
NULL, reset_enum_callback, TRUE))) 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; present_parameters->BackBufferCount = swapchain_desc.backbuffer_count;
implicit_swapchain = wined3d_swapchain_get_parent(device->implicit_swapchain); implicit_swapchain = wined3d_swapchain_get_parent(device->implicit_swapchain);
implicit_swapchain->swap_interval implicit_swapchain->swap_interval