Stefan Dösinger : ddraw/tests: Clear the DXT3 destination surface manually.
Alexandre Julliard
julliard at winehq.org
Mon Feb 17 15:42:16 CST 2020
Module: wine
Branch: master
Commit: 36012feb6d60ae787e103fd0b45bce75150b4706
URL: https://source.winehq.org/git/wine.git/?a=commit;h=36012feb6d60ae787e103fd0b45bce75150b4706
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Sat Feb 15 17:24:34 2020 +0300
ddraw/tests: Clear the DXT3 destination surface manually.
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/ddraw7.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 51223e62ac..8ccfbd4cd8 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -17141,6 +17141,23 @@ static void test_compressed_surface_stretch(void)
hr = IDirectDraw7_CreateSurface(ddraw, &dst_surface_desc, &dst_surf, NULL);
ok(hr == DD_OK, "Test (%u, %u, %u, %u), got unexpected hr %#x.\n", i, j, k, l, hr);
+ memset(&lock, 0, sizeof(lock));
+ lock.dwSize = sizeof(lock);
+
+ /* r200 does not init vidmem DXT3 surfaces to 0 correctly. Do it manually.
+ * We can't use DDBLT_COLORFILL on compressed surfaces, so we need memset.
+ *
+ * Locking alone is not enough, so this isn't an accidental workaround that
+ * forces a different codepath because the destination is currently in sysmem. */
+ if (test_formats[l].fmt.dwFourCC == MAKEFOURCC('D', 'X', 'T', '3'))
+ {
+ hr = IDirectDrawSurface7_Lock(dst_surf, NULL, &lock, 0, NULL);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+ memset(lock.lpSurface, 0, U1(lock).dwLinearSize);
+ hr = IDirectDrawSurface7_Unlock(dst_surf, NULL);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+ }
+
hr = IDirectDrawSurface7_Blt(dst_surf, &dst_rect, src_surf, &src_rect, DDBLT_WAIT, NULL);
todo_wine_if(test_formats[l].fmt.dwFlags == DDPF_FOURCC && test_sizes[j].todo_dst)
ok(hr == DD_OK, "Test (%u, %u, %u, %u), got unexpected hr %#x.\n", i, j, k, l, hr);
More information about the wine-cvs
mailing list