[PATCH 2/4] ddraw/tests: Prefer 16 bit depth buffers in ddraw1 and 2.

Stefan Dösinger stefan at codeweavers.com
Fri Apr 21 10:01:50 CDT 2017


Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
---
 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;
-- 
2.10.2




More information about the wine-patches mailing list