Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 22 ++++++++++++++++++++-- dlls/wined3d/device.c | 16 ---------------- 2 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index da884544ea..4dfc88a1a8 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1039,6 +1039,24 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device, present_parameters->BackBufferCount = swapchain_desc.backbuffer_count;
device->device_state = D3D9_DEVICE_STATE_OK; + + if (extended) + { + const struct wined3d_viewport *current = &wined3d_stateblock_get_state(device->state)->viewport; + struct wined3d_viewport vp; + RECT rect; + + vp.x = 0; + vp.y = 0; + vp.width = swapchain_desc.backbuffer_width; + vp.height = swapchain_desc.backbuffer_height; + vp.min_z = current->min_z; + vp.max_z = current->max_z; + wined3d_stateblock_set_viewport(device->state, &vp); + + SetRect(&rect, 0, 0, swapchain_desc.backbuffer_width, swapchain_desc.backbuffer_height); + wined3d_stateblock_set_scissor_rect(device->state, &rect); + } }
rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0); @@ -2158,7 +2176,7 @@ static HRESULT WINAPI d3d9_device_GetViewport(IDirect3DDevice9Ex *iface, D3DVIEW TRACE("iface %p, viewport %p.\n", iface, viewport);
wined3d_mutex_lock(); - wined3d_device_get_viewports(device->wined3d_device, NULL, &wined3d_viewport); + wined3d_viewport = wined3d_stateblock_get_state(device->state)->viewport; wined3d_mutex_unlock();
viewport->X = wined3d_viewport.x; @@ -2737,7 +2755,7 @@ static HRESULT WINAPI d3d9_device_GetScissorRect(IDirect3DDevice9Ex *iface, RECT TRACE("iface %p, rect %p.\n", iface, rect);
wined3d_mutex_lock(); - wined3d_device_get_scissor_rects(device->wined3d_device, NULL, rect); + *rect = wined3d_stateblock_get_state(device->state)->scissor_rect; wined3d_mutex_unlock();
return D3D_OK; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index fc4933bd72..8405643741 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5576,24 +5576,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, device_load_logo(device, wined3d_settings.logo); } else if ((view = device->back_buffer_view)) - { - struct wined3d_state *state = &device->state; - wined3d_device_set_rendertarget_view(device, 0, view, FALSE);
- /* Note the min_z / max_z is not reset. */ - state->viewports[0].x = 0; - state->viewports[0].y = 0; - state->viewports[0].width = view->width; - state->viewports[0].height = view->height; - state->viewport_count = 1; - wined3d_cs_emit_set_viewports(device->cs, 1, state->viewports); - - SetRect(&state->scissor_rects[0], 0, 0, view->width, view->height); - state->scissor_rect_count = 1; - wined3d_cs_emit_set_scissor_rects(device->cs, 1, state->scissor_rects); - } - if (device->d3d_initialized && reset_state) hr = device->adapter->adapter_ops->adapter_init_3d(device);