wined3d: Invalidate the depth/stencil view if the depth/stencil state may be written.

This allows menu items to be rendered in Snowrunner.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-06-02 20:23:49 -05:00 committed by Alexandre Julliard
parent fe85514479
commit 93d51e64a7

View file

@ -146,9 +146,25 @@ void * CDECL wined3d_depth_stencil_state_get_parent(const struct wined3d_depth_s
return state->parent;
}
static bool stencil_op_writes_ds(const struct wined3d_stencil_op_desc *desc)
{
return desc->fail_op != WINED3D_STENCIL_OP_KEEP
|| desc->depth_fail_op != WINED3D_STENCIL_OP_KEEP
|| desc->pass_op != WINED3D_STENCIL_OP_KEEP;
}
static bool depth_stencil_state_desc_writes_ds(const struct wined3d_depth_stencil_state_desc *desc)
{
return desc->depth_write;
if (desc->depth_write)
return true;
if (desc->stencil && desc->stencil_write_mask)
{
if (stencil_op_writes_ds(&desc->front) || stencil_op_writes_ds(&desc->back))
return true;
}
return false;
}
HRESULT CDECL wined3d_depth_stencil_state_create(struct wined3d_device *device,