Henri Verbeet : wined3d: Disallow stencil size mismatches in wined3d_check_pixel_format_depth() if the format has stencil bits.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Nov 4 09:40:40 CST 2015


Module: wine
Branch: master
Commit: 27e65fb963b177a1c1ca0a3cbb0de147f318969a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=27e65fb963b177a1c1ca0a3cbb0de147f318969a

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Nov  4 00:02:47 2015 +0100

wined3d: Disallow stencil size mismatches in wined3d_check_pixel_format_depth() if the format has stencil bits.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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;




More information about the wine-cvs mailing list