Module: wine Branch: master Commit: 3e51b67e31a707dc734a884318cc7b930ced8532 URL: https://gitlab.winehq.org/wine/wine/-/commit/3e51b67e31a707dc734a884318cc7b9...
Author: Zebediah Figura zfigura@codeweavers.com Date: Thu Dec 29 17:46:54 2022 -0600
wined3d: Pass a wined3d_stateblock_state to wined3d_device_validate_device().
Revert the use of wined3d_state_uses_depth_buffer() in this function to the version before 8b4e07d5f3ab.
---
dlls/d3d8/device.c | 3 +-- dlls/d3d9/device.c | 3 +-- dlls/ddraw/device.c | 3 +-- dlls/wined3d/device.c | 11 +++++------ dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 3 ++- 6 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index e13a1ad465a..3f0af7ab6f0 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2424,8 +2424,7 @@ static HRESULT WINAPI d3d8_device_ValidateDevice(IDirect3DDevice8 *iface, DWORD TRACE("iface %p, pass_count %p.\n", iface, pass_count);
wined3d_mutex_lock(); - wined3d_device_apply_stateblock(device->wined3d_device, device->state); - hr = wined3d_device_validate_device(device->wined3d_device, pass_count); + hr = wined3d_device_validate_device(device->wined3d_device, device->stateblock_state, pass_count); wined3d_mutex_unlock();
/* In d3d8, texture filters are not validated, so errors concerning diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 4351f005eb9..0a031f854af 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2899,8 +2899,7 @@ static HRESULT WINAPI d3d9_device_ValidateDevice(IDirect3DDevice9Ex *iface, DWOR TRACE("iface %p, pass_count %p.\n", iface, pass_count);
wined3d_mutex_lock(); - wined3d_device_apply_stateblock(device->wined3d_device, device->state); - hr = wined3d_device_validate_device(device->wined3d_device, pass_count); + hr = wined3d_device_validate_device(device->wined3d_device, device->stateblock_state, pass_count); wined3d_mutex_unlock();
return hr; diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 80556e96787..dee7f2c8cb9 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5079,8 +5079,7 @@ static HRESULT d3d_device7_ValidateDevice(IDirect3DDevice7 *iface, DWORD *pass_c TRACE("iface %p, pass_count %p.\n", iface, pass_count);
wined3d_mutex_lock(); - wined3d_device_apply_stateblock(device->wined3d_device, device->state); - hr = wined3d_device_validate_device(device->wined3d_device, pass_count); + hr = wined3d_device_validate_device(device->wined3d_device, device->stateblock_state, pass_count); wined3d_mutex_unlock();
return hr; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 4b9ea98a04d..21848f9cea4 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3701,9 +3701,9 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3D_OK; }
-HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes) +HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, const struct wined3d_stateblock_state *state, DWORD *num_passes) { - const struct wined3d_state *state = device->cs->c.state; + const struct wined3d_state *device_state = device->cs->c.state; struct wined3d_texture *texture; unsigned i;
@@ -3744,11 +3744,10 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device } }
- if (wined3d_state_uses_depth_buffer(state) - || (state->depth_stencil_state && state->depth_stencil_state->desc.stencil)) + if (state->rs[WINED3D_RS_ZENABLE] || state->rs[WINED3D_RS_ZWRITEENABLE] || state->rs[WINED3D_RS_STENCILENABLE]) { - struct wined3d_rendertarget_view *rt = state->fb.render_targets[0]; - struct wined3d_rendertarget_view *ds = state->fb.depth_stencil; + struct wined3d_rendertarget_view *rt = device_state->fb.render_targets[0]; + struct wined3d_rendertarget_view *ds = device_state->fb.depth_stencil;
if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 3094fac6f3c..7ab1d8c5804 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -87,7 +87,7 @@ @ cdecl wined3d_device_set_software_vertex_processing(ptr long) @ cdecl wined3d_device_show_cursor(ptr long) @ cdecl wined3d_device_update_texture(ptr ptr ptr) -@ cdecl wined3d_device_validate_device(ptr ptr) +@ cdecl wined3d_device_validate_device(ptr ptr ptr)
@ cdecl wined3d_device_context_blt(ptr ptr long ptr ptr long ptr long ptr long) @ cdecl wined3d_device_context_clear_rendertarget_view(ptr ptr ptr long ptr float long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index ee2eb02902f..7bc9559526e 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2419,7 +2419,8 @@ void __cdecl wined3d_device_set_software_vertex_processing(struct wined3d_device BOOL __cdecl wined3d_device_show_cursor(struct wined3d_device *device, BOOL show); HRESULT __cdecl wined3d_device_update_texture(struct wined3d_device *device, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture); -HRESULT __cdecl wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes); +HRESULT __cdecl wined3d_device_validate_device(const struct wined3d_device *device, + const struct wined3d_stateblock_state *state, DWORD *num_passes);
HRESULT __cdecl wined3d_device_context_blt(struct wined3d_device_context *context, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect,