Commit 48504e73 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d9: Set depth test state while resetting device.

wined3d will not do this anymore. Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a34c7f26
...@@ -812,11 +812,13 @@ static HRESULT d3d9_device_get_swapchains(struct d3d9_device *device) ...@@ -812,11 +812,13 @@ static HRESULT d3d9_device_get_swapchains(struct d3d9_device *device)
static HRESULT d3d9_device_reset(struct d3d9_device *device, static HRESULT d3d9_device_reset(struct d3d9_device *device,
D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode) D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode)
{ {
BOOL extended = device->d3d_parent->extended;
struct wined3d_swapchain_desc swapchain_desc; struct wined3d_swapchain_desc swapchain_desc;
struct wined3d_display_mode wined3d_mode; struct wined3d_display_mode wined3d_mode;
HRESULT hr; HRESULT hr;
if (!device->d3d_parent->extended && device->device_state == D3D9_DEVICE_STATE_LOST)
if (!extended && device->device_state == D3D9_DEVICE_STATE_LOST)
{ {
WARN("App not active, returning D3DERR_DEVICELOST.\n"); WARN("App not active, returning D3DERR_DEVICELOST.\n");
return D3DERR_DEVICELOST; return D3DERR_DEVICELOST;
...@@ -831,8 +833,7 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device, ...@@ -831,8 +833,7 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device,
wined3d_mode.scanline_ordering = mode->ScanLineOrdering; wined3d_mode.scanline_ordering = mode->ScanLineOrdering;
} }
if (!wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters, if (!wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters, extended))
device->d3d_parent->extended))
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
wined3d_mutex_lock(); wined3d_mutex_lock();
...@@ -852,10 +853,16 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device, ...@@ -852,10 +853,16 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device,
} }
if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc, if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc,
mode ? &wined3d_mode : NULL, reset_enum_callback, !device->d3d_parent->extended))) mode ? &wined3d_mode : NULL, reset_enum_callback, !extended)))
{ {
HeapFree(GetProcessHeap(), 0, device->implicit_swapchains); HeapFree(GetProcessHeap(), 0, device->implicit_swapchains);
if (!extended)
{
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ZENABLE,
!!swapchain_desc.enable_auto_depth_stencil);
}
if (FAILED(hr = d3d9_device_get_swapchains(device))) if (FAILED(hr = d3d9_device_get_swapchains(device)))
{ {
device->device_state = D3D9_DEVICE_STATE_NOT_RESET; device->device_state = D3D9_DEVICE_STATE_NOT_RESET;
...@@ -871,7 +878,7 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device, ...@@ -871,7 +878,7 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device,
device->device_state = D3D9_DEVICE_STATE_OK; device->device_state = D3D9_DEVICE_STATE_OK;
} }
} }
else if (!device->d3d_parent->extended) else if (!extended)
{ {
device->device_state = D3D9_DEVICE_STATE_NOT_RESET; device->device_state = D3D9_DEVICE_STATE_NOT_RESET;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment