Stefan Dösinger : wined3d: Take the format into account when finding the clear value.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Aug 31 07:22:17 CDT 2007


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

Author: Stefan Dösinger <stefandoesinger at gmx.at>
Date:   Mon Aug 27 22:01:06 2007 +0200

wined3d: Take the format into account when finding the clear value.

---

 dlls/wined3d/surface.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b2d3aa1..49c2218 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3281,15 +3281,36 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
 static HRESULT WINAPI IWineD3DSurfaceImpl_BltZ(IWineD3DSurfaceImpl *This, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, WINEDDBLTFX *DDBltFx)
 {
     IWineD3DDeviceImpl *myDevice = This->resource.wineD3DDevice;
+    float depth;
+
+    if (Flags & WINEDDBLT_DEPTHFILL) {
+        switch(This->resource.format) {
+            case WINED3DFMT_D16:
+                depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x0000ffff;
+                break;
+            case WINED3DFMT_D15S1:
+                depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x0000fffe;
+                break;
+            case WINED3DFMT_D24S8:
+            case WINED3DFMT_D24X8:
+                depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x00ffffff;
+                break;
+            case WINED3DFMT_D32:
+                depth = (float) DDBltFx->u5.dwFillDepth / (float) 0xffffffff;
+                break;
+            default:
+                depth = 0.0;
+                ERR("Unexpected format for depth fill: %s\n", debug_d3dformat(This->resource.format));
+        }
 
-    if (Flags & WINEDDBLT_DEPTHFILL)
         return IWineD3DDevice_Clear((IWineD3DDevice *) myDevice,
                                     DestRect == NULL ? 0 : 1,
                                     (WINED3DRECT *) DestRect,
                                     WINED3DCLEAR_ZBUFFER,
                                     0x00000000,
-                                    (float) DDBltFx->u5.dwFillDepth / (float) MAXDWORD,
+                                    depth,
                                     0x00000000);
+    }
 
     FIXME("(%p): Unsupp depthstencil blit\n", This);
     return WINED3DERR_INVALIDCALL;




More information about the wine-cvs mailing list