Signed-off-by: Stefan Dösinger stefan@codeweavers.com --- 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 51223e62acd..8ccfbd4cd8a 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);
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
See e.g. http://test.winehq.org/data/7332de64a5a204cc285bdc1f8768d3217103b7dd/win10_n... . I addedd the colorfill to separate writing 0 from not blitting at all. --- dlls/ddraw/tests/ddraw1.c | 14 ++++++++++---- dlls/ddraw/tests/ddraw2.c | 14 ++++++++++---- dlls/ddraw/tests/ddraw4.c | 14 ++++++++++---- dlls/ddraw/tests/ddraw7.c | 14 ++++++++++---- 4 files changed, 40 insertions(+), 16 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 61f0adcd7ef..ca64d3e6c88 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -5869,6 +5869,11 @@ static void test_p8_blit(void) hr = IDirectDrawSurface_Unlock(dst_p8, NULL); ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#x.\n", hr);
+ fx.dwSize = sizeof(fx); + fx.dwFillColor = 0xdeadbeef; + hr = IDirectDrawSurface_Blt(dst, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); + ok(SUCCEEDED(hr), "Failed to color fill %#x.\n", hr); + hr = IDirectDrawSurface_SetPalette(src, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); @@ -5882,14 +5887,15 @@ static void test_p8_blit(void) for (x = 0; x < ARRAY_SIZE(expected); x++) { color = get_surface_color(dst, x, 0); - todo_wine ok(compare_color(color, expected[x], 0), + /* WARP on 1709 and newer write zeroes on non-colorkeyed P8 -> RGB blits. For ckey + * blits see below. */ + todo_wine ok(compare_color(color, expected[x], 0) + || broken(is_warp && compare_color(color, 0x00000000, 0)), "Pixel %u: Got color %#x, expected %#x.\n", x, color, expected[x]); } }
- memset(&fx, 0, sizeof(fx)); - fx.dwSize = sizeof(fx); fx.ddckSrcColorkey.dwColorSpaceHighValue = 0x2; fx.ddckSrcColorkey.dwColorSpaceLowValue = 0x2; hr = IDirectDrawSurface_Blt(dst_p8, NULL, src, NULL, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &fx); @@ -5898,7 +5904,7 @@ static void test_p8_blit(void) hr = IDirectDrawSurface_Lock(dst_p8, NULL, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#x.\n", hr); /* A color keyed P8 blit doesn't do anything on WARP - it just leaves the data in the destination - * surface untouched. P8 blits without color keys work. Error checking (DDBLT_KEYSRC without a key + * surface untouched. Error checking (DDBLT_KEYSRC without a key * for example) also works as expected. * * Using DDBLT_KEYSRC instead of DDBLT_KEYSRCOVERRIDE doesn't change this. Doing this blit with diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 6e35bfd534b..7dfb35d2d3a 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -6824,6 +6824,11 @@ static void test_p8_blit(void) hr = IDirectDrawSurface_Unlock(dst_p8, NULL); ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#x.\n", hr);
+ fx.dwSize = sizeof(fx); + fx.dwFillColor = 0xdeadbeef; + hr = IDirectDrawSurface_Blt(dst, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); + ok(SUCCEEDED(hr), "Failed to color fill %#x.\n", hr); + hr = IDirectDrawSurface_SetPalette(src, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); @@ -6837,14 +6842,15 @@ static void test_p8_blit(void) for (x = 0; x < ARRAY_SIZE(expected); x++) { color = get_surface_color(dst, x, 0); - todo_wine ok(compare_color(color, expected[x], 0), + /* WARP on 1709 and newer write zeroes on non-colorkeyed P8 -> RGB blits. For ckey + * blits see below. */ + todo_wine ok(compare_color(color, expected[x], 0) + || broken(is_warp && compare_color(color, 0x00000000, 0)), "Pixel %u: Got color %#x, expected %#x.\n", x, color, expected[x]); } }
- memset(&fx, 0, sizeof(fx)); - fx.dwSize = sizeof(fx); fx.ddckSrcColorkey.dwColorSpaceHighValue = 0x2; fx.ddckSrcColorkey.dwColorSpaceLowValue = 0x2; hr = IDirectDrawSurface7_Blt(dst_p8, NULL, src, NULL, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &fx); @@ -6853,7 +6859,7 @@ static void test_p8_blit(void) hr = IDirectDrawSurface_Lock(dst_p8, NULL, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#x.\n", hr); /* A color keyed P8 blit doesn't do anything on WARP - it just leaves the data in the destination - * surface untouched. P8 blits without color keys work. Error checking (DDBLT_KEYSRC without a key + * surface untouched. Error checking (DDBLT_KEYSRC without a key * for example) also works as expected. * * Using DDBLT_KEYSRC instead of DDBLT_KEYSRCOVERRIDE doesn't change this. Doing this blit with diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index b53c0c2160e..e1d5bac18bb 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -8650,6 +8650,11 @@ static void test_p8_blit(void) hr = IDirectDrawSurface4_Unlock(dst_p8, NULL); ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#x.\n", hr);
+ fx.dwSize = sizeof(fx); + fx.dwFillColor = 0xdeadbeef; + hr = IDirectDrawSurface4_Blt(dst, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); + ok(SUCCEEDED(hr), "Failed to color fill %#x.\n", hr); + hr = IDirectDrawSurface4_SetPalette(src, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); hr = IDirectDrawSurface4_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); @@ -8663,14 +8668,15 @@ static void test_p8_blit(void) for (x = 0; x < ARRAY_SIZE(expected); x++) { color = get_surface_color(dst, x, 0); - todo_wine ok(compare_color(color, expected[x], 0), + /* WARP on 1709 and newer write zeroes on non-colorkeyed P8 -> RGB blits. For ckey + * blits see below. */ + todo_wine ok(compare_color(color, expected[x], 0) + || broken(is_warp && compare_color(color, 0x00000000, 0)), "Pixel %u: Got color %#x, expected %#x.\n", x, color, expected[x]); } }
- memset(&fx, 0, sizeof(fx)); - fx.dwSize = sizeof(fx); fx.ddckSrcColorkey.dwColorSpaceHighValue = 0x2; fx.ddckSrcColorkey.dwColorSpaceLowValue = 0x2; hr = IDirectDrawSurface4_Blt(dst_p8, NULL, src, NULL, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &fx); @@ -8679,7 +8685,7 @@ static void test_p8_blit(void) hr = IDirectDrawSurface4_Lock(dst_p8, NULL, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#x.\n", hr); /* A color keyed P8 blit doesn't do anything on WARP - it just leaves the data in the destination - * surface untouched. P8 blits without color keys work. Error checking (DDBLT_KEYSRC without a key + * surface untouched. Error checking (DDBLT_KEYSRC without a key * for example) also works as expected. * * Using DDBLT_KEYSRC instead of DDBLT_KEYSRCOVERRIDE doesn't change this. Doing this blit with diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 8ccfbd4cd8a..3ad44991863 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -8509,6 +8509,11 @@ static void test_p8_blit(void) hr = IDirectDrawSurface7_Unlock(dst_p8, NULL); ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#x.\n", hr);
+ fx.dwSize = sizeof(fx); + fx.dwFillColor = 0xdeadbeef; + hr = IDirectDrawSurface7_Blt(dst, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); + ok(SUCCEEDED(hr), "Failed to color fill %#x.\n", hr); + hr = IDirectDrawSurface7_SetPalette(src, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); hr = IDirectDrawSurface7_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); @@ -8522,14 +8527,15 @@ static void test_p8_blit(void) for (x = 0; x < ARRAY_SIZE(expected); ++x) { color = get_surface_color(dst, x, 0); - todo_wine ok(compare_color(color, expected[x], 0), + /* WARP on 1709 and newer write zeroes on non-colorkeyed P8 -> RGB blits. For ckey + * blits see below. */ + todo_wine ok(compare_color(color, expected[x], 0) + || broken(is_warp && compare_color(color, 0x00000000, 0)), "Pixel %u: Got color %#x, expected %#x.\n", x, color, expected[x]); } }
- memset(&fx, 0, sizeof(fx)); - fx.dwSize = sizeof(fx); fx.ddckSrcColorkey.dwColorSpaceHighValue = 0x2; fx.ddckSrcColorkey.dwColorSpaceLowValue = 0x2; hr = IDirectDrawSurface7_Blt(dst_p8, NULL, src, NULL, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &fx); @@ -8538,7 +8544,7 @@ static void test_p8_blit(void) hr = IDirectDrawSurface7_Lock(dst_p8, NULL, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#x.\n", hr); /* A color keyed P8 blit doesn't do anything on WARP - it just leaves the data in the destination - * surface untouched. P8 blits without color keys work. Error checking (DDBLT_KEYSRC without a key + * surface untouched. Error checking (DDBLT_KEYSRC without a key * for example) also works as expected. * * Using DDBLT_KEYSRC instead of DDBLT_KEYSRCOVERRIDE doesn't change this. Doing this blit with
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65249
Your paranoid android.
=== w1064v1809_he (32 bit report) ===
ddraw: ddraw1.c:7317: Test failed: Got unexpected hr 0x887601c2.
=== w8adm (32 bit report) ===
ddraw: ddraw7.c:2964: Test failed: Failed to create surface, hr 0x887601c2. 0cfc:ddraw7: unhandled exception c0000005 at 0051530B
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
ddraw2-7 don't need to be changed because they already expect this result as the normal case. It's ddraw1 that begs to differ in a weird way and WARP does the "correct" thing that matches later versions. --- dlls/ddraw/tests/ddraw1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index ca64d3e6c88..98b83334122 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -7314,7 +7314,8 @@ static void test_lost_device(void) hr = IDirectDrawSurface_IsLost(surface); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE || broken(ddraw_is_warp(ddraw) && hr == DDERR_SURFACELOST), + "Got unexpected hr %#x.\n", hr);
/* Trying to restore the primary will crash, probably because flippable * surfaces can't exist in DDSCL_NORMAL. */
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65250
Your paranoid android.
=== w1064v1809 (32 bit report) ===
ddraw: ddraw1.c:12582: Test failed: WM_KILLFOCUS was not received. ddraw1.c:12618: Test failed: Got unexpected hr 0x887600e1. ddraw1.c:12621: Test failed: Got unexpected hr 0x887600ff. 1994:ddraw1: unhandled exception c0000005 at 00410AC0
=== w1064v1809_2scr (32 bit report) ===
ddraw: ddraw1.c:1904: Test failed: Got unexpected color 0x000000ff.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65248
Your paranoid android.
=== w1064v1809_he (32 bit report) ===
ddraw: ddraw7.c:8525: Test failed: Pixel 0: Got color 0, expected 0x101010. ddraw7.c:8525: Test failed: Pixel 1: Got color 0, expected 0x10101. ddraw7.c:8525: Test failed: Pixel 2: Got color 0, expected 0x20202. ddraw7.c:8525: Test failed: Pixel 3: Got color 0, expected 0x30303. ddraw7.c:8525: Test failed: Pixel 4: Got color 0, expected 0x40404. ddraw7.c:8525: Test failed: Pixel 5: Got color 0, expected 0x50505. ddraw7.c:8525: Test failed: Pixel 6: Got color 0, expected 0xffffff. ddraw7.c:8525: Test failed: Pixel 7: Got color 0, expected 0x808080.