Roderick Colenbrander : wined3d: Always report D16 as Windows drivers report it on all cards ( likely using emulation).

Alexandre Julliard julliard at winehq.org
Tue Mar 25 14:19:48 CDT 2008


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

Author: Roderick Colenbrander <thunderbird2k at gmx.net>
Date:   Tue Mar 25 11:02:20 2008 +0100

wined3d: Always report D16 as Windows drivers report it on all cards (likely using emulation).

---

 dlls/wined3d/directx.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 0719ea1..ef6b6df 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1656,6 +1656,7 @@ static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt(const WineD3D_Pixe
 
 static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithDepthFmt(const WineD3D_PixelFormat *cfg, WINED3DFORMAT Format) {
     short depthSize, stencilSize;
+    BOOL lockable = FALSE;
 
     if(!cfg)
         return FALSE;
@@ -1665,7 +1666,13 @@ static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithDepthFmt(const WineD3D_Pixel
         return FALSE;
     }
 
-    if(cfg->depthSize != depthSize)
+    if((Format == WINED3DFMT_D16_LOCKABLE) || (Format == WINED3DFMT_D32F_LOCKABLE))
+        lockable = TRUE;
+
+    /* On some modern cards like the Geforce8/9 GLX doesn't offer some dephthstencil formats which D3D9 reports.
+     * We can safely report 'compatible' formats (e.g. D24 can be used for D16) as long as we aren't dealing with
+     * a lockable format. This also helps D3D <= 7 as they expect D16 which isn't offered without this on Geforce8 cards. */
+    if(!(cfg->depthSize == depthSize || (!lockable && cfg->depthSize > depthSize)))
         return FALSE;
 
     if(cfg->stencilSize != stencilSize)




More information about the wine-cvs mailing list