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);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 4dfc88a1a8..cff3a5c898 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2161,8 +2161,6 @@ static HRESULT WINAPI d3d9_device_SetViewport(IDirect3DDevice9Ex *iface, const D
wined3d_mutex_lock(); wined3d_stateblock_set_viewport(device->update_state, &vp); - if (!device->recording) - wined3d_device_set_viewports(device->wined3d_device, 1, &vp); wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index cff3a5c898..3609dddb39 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2739,8 +2739,6 @@ static HRESULT WINAPI d3d9_device_SetScissorRect(IDirect3DDevice9Ex *iface, cons
wined3d_mutex_lock(); wined3d_stateblock_set_scissor_rect(device->update_state, rect); - if (!device->recording) - wined3d_device_set_scissor_rects(device->wined3d_device, 1, rect); wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 3609dddb39..789f5a9c18 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3338,7 +3338,7 @@ static HRESULT WINAPI d3d9_device_GetVertexDeclaration(IDirect3DDevice9Ex *iface if (!declaration) return D3DERR_INVALIDCALL;
wined3d_mutex_lock(); - if ((wined3d_declaration = wined3d_device_get_vertex_declaration(device->wined3d_device))) + if ((wined3d_declaration = wined3d_stateblock_get_state(device->state)->vertex_declaration)) { declaration_impl = wined3d_vertex_declaration_get_parent(wined3d_declaration); *declaration = &declaration_impl->IDirect3DVertexDeclaration9_iface; @@ -3460,7 +3460,7 @@ static HRESULT WINAPI d3d9_device_GetFVF(IDirect3DDevice9Ex *iface, DWORD *fvf) TRACE("iface %p, fvf %p.\n", iface, fvf);
wined3d_mutex_lock(); - if ((wined3d_declaration = wined3d_device_get_vertex_declaration(device->wined3d_device))) + if ((wined3d_declaration = wined3d_stateblock_get_state(device->state)->vertex_declaration)) { d3d9_declaration = wined3d_vertex_declaration_get_parent(wined3d_declaration); *fvf = d3d9_declaration->fvf;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 789f5a9c18..c59d83b11a 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3317,9 +3317,6 @@ static HRESULT WINAPI d3d9_device_SetVertexDeclaration(IDirect3DDevice9Ex *iface wined3d_mutex_lock(); wined3d_stateblock_set_vertex_declaration(device->update_state, decl_impl ? decl_impl->wined3d_declaration : NULL); - if (!device->recording) - wined3d_device_set_vertex_declaration(device->wined3d_device, - decl_impl ? decl_impl->wined3d_declaration : NULL); device->has_vertex_declaration = !!decl_impl; wined3d_mutex_unlock();
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
On Fri, 7 Feb 2020 at 05:09, Zebediah Figura z.figura12@gmail.com wrote:
Note the minor typo in the subject line. ("d3d9_device_SerVertexDeclaration()" should be "d3d9_device_SetVertexDeclaration()".)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index c59d83b11a..2d5bc77ed7 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3440,8 +3440,6 @@ static HRESULT WINAPI d3d9_device_SetFVF(IDirect3DDevice9Ex *iface, DWORD fvf) }
wined3d_stateblock_set_vertex_declaration(device->update_state, decl); - if (!device->recording) - wined3d_device_set_vertex_declaration(device->wined3d_device, decl); device->has_vertex_declaration = TRUE; wined3d_mutex_unlock();
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com