=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: ddraw/tests: Prefer 16 bit depth buffers in ddraw1 and 2.

Alexandre Julliard julliard at winehq.org
Mon Apr 24 16:11:22 CDT 2017


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Fri Apr 21 17:01:50 2017 +0200

ddraw/tests: Prefer 16 bit depth buffers in ddraw1 and 2.

Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ddraw/tests/ddraw1.c | 6 +++++-
 dlls/ddraw/tests/ddraw2.c | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 26d0423..ea8a3b0 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -431,7 +431,11 @@ static IDirectDraw *create_ddraw(void)
 
 static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coop_level)
 {
-    static const DWORD z_depths[] = {32, 24, 16};
+    /* Prefer 16 bit depth buffers because Nvidia gives us an unpadded D24 buffer if we ask
+     * for 24 bit and handles such buffers incorrectly in DDBLT_DEPTHFILL. AMD only supports
+     * 16 bit buffers in ddraw1/2. Stencil was added in ddraw4, so we cannot create a D24S8
+     * buffer here. */
+    static const DWORD z_depths[] = {16, 32, 24};
     IDirectDrawSurface *surface, *ds;
     IDirect3DDevice *device = NULL;
     DDSURFACEDESC surface_desc;
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 2784a55..39e9190 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -301,7 +301,11 @@ static IDirectDraw2 *create_ddraw(void)
 
 static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD coop_level)
 {
-    static const DWORD z_depths[] = {32, 24, 16};
+    /* Prefer 16 bit depth buffers because Nvidia gives us an unpadded D24 buffer if we ask
+     * for 24 bit and handles such buffers incorrectly in DDBLT_DEPTHFILL. AMD only supports
+     * 16 bit buffers in ddraw1/2. Stencil was added in ddraw4, so we cannot create a D24S8
+     * buffer here. */
+    static const DWORD z_depths[] = {16, 32, 24};
     IDirectDrawSurface *surface, *ds;
     IDirect3DDevice2 *device = NULL;
     DDSURFACEDESC surface_desc;




More information about the wine-cvs mailing list