[PATCH 4/6] wined3d: Disallow stencil size mismatches in wined3d_check_pixel_format_depth() if the format has stencil bits.
Henri Verbeet
hverbeet at codeweavers.com
Tue Nov 3 17:02:47 CST 2015
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
dlls/wined3d/directx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index e2203ea..a7329e7 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4309,9 +4309,10 @@ static BOOL wined3d_check_pixel_format_depth(const struct wined3d_gl_info *gl_in
return FALSE;
/* Some cards like Intel i915 ones only offer D24S8 but lots of games also
- * need a format without stencil, so allow more stencil bits than
- * requested. */
- if (cfg->stencilSize < format->stencil_size)
+ * need a format without stencil. We can allow a mismatch if the format
+ * doesn't have any stencil bits. If it does have stencil bits the size
+ * must match, or stencil wrapping would break. */
+ if (format->stencil_size && cfg->stencilSize != format->stencil_size)
return FALSE;
return TRUE;
--
2.1.4
More information about the wine-patches
mailing list