[PATCH 4/4] ddraw/tests: Work around an Nvidia DEPTHFILL bug in ddraw2.

Stefan Dösinger stefan at codeweavers.com
Mon Apr 17 15:14:59 CDT 2017


Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
---
 dlls/ddraw/tests/ddraw2.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 5f864cc..ef83874 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -1193,7 +1193,17 @@ static void test_depth_blit(void)
     ok(SUCCEEDED(hr), "Failed to clear the color and z buffers, hr %#x.\n", hr);
 
     SetRect(&dst_rect, 0, 0, 320, 240);
-    hr = IDirectDrawSurface_Blt(ds1, &dst_rect, ds2, NULL, DDBLT_WAIT, NULL);
+    /* Nvidia drivers (Tested on Geforce 7 to Geforce 650) on Windows incorrectly handle
+     * depth fills in ddraw2. X axis coordinates are scaled by 3/4, so we end up clearing
+     * a 480x480 rectangle. The scaling is independent of the surface, window and screen
+     * sizes. ddraw1, ddraw4 and ddraw7 work OK. Clearing with Viewport::Clear also works,
+     * but because depth stencil switching doesn't work OK on other drivers we can't use
+     * it.
+     *
+     * The depth blit itself works fine. Use a 480x480 source rectangle to exclude the
+     * area of the source surface that may not be filled correctly. */
+    SetRect(&src_rect, 0, 0, 480, 480);
+    hr = IDirectDrawSurface_Blt(ds1, &dst_rect, ds2, &src_rect, DDBLT_WAIT, NULL);
     ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
     IDirectDrawSurface_Release(ds3);
     IDirectDrawSurface_Release(ds2);
-- 
2.10.2




More information about the wine-patches mailing list