=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Always check if format has depth/ stencil flags in wined3d_check_depth_stencil_format().

Alexandre Julliard julliard at winehq.org
Thu Mar 28 18:35:12 CDT 2019


Module: wine
Branch: master
Commit: 1e9277bf9748e20e04925896b16f09d48b2d1d00
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1e9277bf9748e20e04925896b16f09d48b2d1d00

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Mar 28 09:53:49 2019 +0100

wined3d: Always check if format has depth/stencil flags in wined3d_check_depth_stencil_format().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/directx.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 381ed65..612b813 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1434,6 +1434,8 @@ static BOOL wined3d_check_depth_stencil_format(const struct wined3d_adapter *ada
 {
     if (!ds_format->depth_size && !ds_format->stencil_size)
         return FALSE;
+    if (!(ds_format->flags[gl_type] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)))
+        return FALSE;
 
     /* Blacklist formats not supported on Windows */
     if (ds_format->id == WINED3DFMT_S1_UINT_D15_UNORM /* Breaks the shadowvol2 dx7 sdk sample */
@@ -1443,13 +1445,7 @@ static BOOL wined3d_check_depth_stencil_format(const struct wined3d_adapter *ada
         return FALSE;
     }
 
-    if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
-    {
-        /* With FBOs WGL limitations do not apply, but the format needs to be FBO attachable */
-        if (ds_format->flags[gl_type] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
-            return TRUE;
-    }
-    else
+    if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER)
     {
         unsigned int i;
 
@@ -1460,9 +1456,11 @@ static BOOL wined3d_check_depth_stencil_format(const struct wined3d_adapter *ada
                     && wined3d_check_pixel_format_depth(cfg, ds_format))
                 return TRUE;
         }
+
+        return FALSE;
     }
 
-    return FALSE;
+    return TRUE;
 }
 
 /* Check the render target capabilities of a format */




More information about the wine-cvs mailing list