Zebediah Figura : wined3d: Invalidate the depth/stencil view if the depth/stencil state may be written.
Alexandre Julliard
julliard at winehq.org
Fri Jun 3 15:53:08 CDT 2022
Module: wine
Branch: master
Commit: 93d51e64a7a82693993a3b166ee5aa4256bb42d5
URL: https://source.winehq.org/git/wine.git/?a=commit;h=93d51e64a7a82693993a3b166ee5aa4256bb42d5
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Thu Jun 2 20:23:49 2022 -0500
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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/state.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 228b4901c00..a732182d6c5 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -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,
More information about the wine-cvs
mailing list