H. Verbeet : wined3d: Handle depth formats like any other format in CheckDeviceFormat.

Alexandre Julliard julliard at winehq.org
Fri Jun 20 06:21:45 CDT 2008


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

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Thu Jun 19 18:24:23 2008 +0200

wined3d: Handle depth formats like any other format in CheckDeviceFormat.

Currently depth formats are handled separately from the other formats,
but depth formats can support things like filtering as well, so we
should check those caps as well.

---

 dlls/wined3d/directx.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 61ab9d1..ace6199 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -2212,7 +2212,9 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
             TRACE_(d3d_caps)("[OK]\n");
             return TRUE;
 
-        /* Depth/stencil is handled using checkDepthStencilCapability, return FALSE here */
+        /*****
+         *  Supported: Depth/Stencil formats
+         */
         case WINED3DFMT_D16_LOCKABLE:
         case WINED3DFMT_D16:
         case WINED3DFMT_D15S1:
@@ -2222,7 +2224,7 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
         case WINED3DFMT_D24FS8:
         case WINED3DFMT_D32:
         case WINED3DFMT_D32F_LOCKABLE:
-            return FALSE;
+            return TRUE;
 
         /*****
          *  Not supported everywhere(depends on GL_ATI_envmap_bumpmap or
@@ -2669,9 +2671,15 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
                     return WINED3DERR_NOTAVAILABLE;
                 }
             }
-        } else if(CheckDepthStencilCapability(Adapter, AdapterFormat, CheckFormat)) {
-            if(Usage & WINED3DUSAGE_DEPTHSTENCIL)
-                UsageCaps |= WINED3DUSAGE_DEPTHSTENCIL;
+
+            if(Usage & WINED3DUSAGE_DEPTHSTENCIL) {
+                if(CheckDepthStencilCapability(Adapter, AdapterFormat, CheckFormat)) {
+                    UsageCaps |= WINED3DUSAGE_DEPTHSTENCIL;
+                } else {
+                    TRACE_(d3d_caps)("[FAILED] - No depth stencil support\n");
+                    return WINED3DERR_NOTAVAILABLE;
+                }
+            }
         } else {
             TRACE_(d3d_caps)("[FAILED] - Texture format not supported\n");
             return WINED3DERR_NOTAVAILABLE;




More information about the wine-cvs mailing list