This fixes test_caps on my GeForce 650M Windows 10 machine.
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
There's a deeper problem with test_caps() though - that this leak causes it to fail is just a symptom. ddraw reports different caps after creating a surface, presumably because some internal plugins get loaded. So the results of test_caps() are potentially misleading. --- dlls/ddraw/tests/ddraw1.c | 3 ++- dlls/ddraw/tests/ddraw2.c | 3 ++- dlls/ddraw/tests/ddraw4.c | 3 ++- dlls/ddraw/tests/ddraw7.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index c10be66236a..26dd8140e4c 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -9478,10 +9478,11 @@ static void test_overlay_rect(void) ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x); ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y);
- IDirectDrawSurface_Release(overlay); done: if (primary) IDirectDrawSurface_Release(primary); + if (overlay) + IDirectDrawSurface_Release(overlay); IDirectDraw_Release(ddraw); DestroyWindow(window); } diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 8d4d44863a1..8e37243e6c1 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -10180,10 +10180,11 @@ static void test_overlay_rect(void) ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x); ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y);
- IDirectDrawSurface_Release(overlay); done: if (primary) IDirectDrawSurface_Release(primary); + if (overlay) + IDirectDrawSurface_Release(overlay); IDirectDraw2_Release(ddraw); DestroyWindow(window); } diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 1a16e2d571e..b6dbd63c885 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -12058,10 +12058,11 @@ static void test_overlay_rect(void) ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x); ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y);
- IDirectDrawSurface4_Release(overlay); done: if (primary) IDirectDrawSurface4_Release(primary); + if (overlay) + IDirectDrawSurface4_Release(overlay); IDirectDraw4_Release(ddraw); DestroyWindow(window); } diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 20a1bc5f3af..be6aca2cec9 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -12049,10 +12049,11 @@ static void test_overlay_rect(void) ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x); ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y);
- IDirectDrawSurface7_Release(overlay); done: if (primary) IDirectDrawSurface7_Release(primary); + if (overlay) + IDirectDrawSurface7_Release(overlay); IDirectDraw7_Release(ddraw); DestroyWindow(window); }
Creating a surface with this flag set behaves in the same way as it does on newer hardware that sets the flag - it succeeds for sysmem surfaces and fails with E_NOTIMPL for vidmem ones.
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
The same flag is also missing on the fg-winxp-lusr machine (VMware SVGA II), but not on newtb-wxppro (vga.dll). It is also set on Windows 7 with a driver describing itself as "VMware SVGA 3D (Microsoft Corporation - WDDM)". So I think it is a property of the driver, not the Windows version. --- dlls/ddraw/tests/ddraw1.c | 1 - dlls/ddraw/tests/ddraw2.c | 1 - dlls/ddraw/tests/ddraw4.c | 1 - dlls/ddraw/tests/ddraw7.c | 1 - 4 files changed, 4 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 26dd8140e4c..faec17742e7 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -13010,7 +13010,6 @@ static void test_caps(void) | DDSCAPS_FRONTBUFFER | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY - | DDSCAPS_OWNDC | DDSCAPS_LOCALVIDMEM | DDSCAPS_NONLOCALVIDMEM;
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 8e37243e6c1..28e97676456 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -13845,7 +13845,6 @@ static void test_caps(void) | DDSCAPS_FRONTBUFFER | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY - | DDSCAPS_OWNDC | DDSCAPS_LOCALVIDMEM | DDSCAPS_NONLOCALVIDMEM;
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index b6dbd63c885..b3983468395 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -16491,7 +16491,6 @@ static void test_caps(void) | DDSCAPS_FRONTBUFFER | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY - | DDSCAPS_OWNDC | DDSCAPS_LOCALVIDMEM | DDSCAPS_NONLOCALVIDMEM;
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index be6aca2cec9..986a1f3a127 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -16463,7 +16463,6 @@ static void test_caps(void) | DDSCAPS_FRONTBUFFER | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY - | DDSCAPS_OWNDC | DDSCAPS_LOCALVIDMEM | DDSCAPS_NONLOCALVIDMEM;
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=63653
Your paranoid android.
=== w1064v1809_zh_CN (32 bit report) ===
ddraw: ddraw1.c:11114: Test failed: Got unexpected color 0x00ffffff.
=== wvistau64 (32 bit report) ===
ddraw: 0910:ddraw4: unhandled exception c0000005 at 74126143
=== wvistau64 (64 bit report) ===
ddraw: 0910:ddraw4: unhandled exception c0000005 at 000007FEF6301883
=== wvistau64 (32 bit report) ===
ddraw: 08d8:ddraw7: unhandled exception c0000005 at 74126143
=== w8adm (32 bit report) ===
ddraw: ddraw7.c:3122: Test failed: Failed to create surface, hr 0x887601c2. 0cfc:ddraw7: unhandled exception c0000005 at 00515D1C
=== wvistau64 (64 bit report) ===
ddraw: 08d8:ddraw7: unhandled exception c0000005 at 000007FEF6301883
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
A user in #winehackers helped me confirm that Nvidia GPUs on Windows XP behave in the same way. It is possible to run Windows 7 with XP drivers, but I don't have a setup like that. It is possible that this is a property of pre-WDDM drivers rather than XP itself, but the test codes it as though it is a WinXP property.
Yes, d3d9 is affected too, but our d3d9 test_caps() is not because it creates sysmem surfaces. --- 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, 44 insertions(+), 12 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index faec17742e7..fc104273d02 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -9805,7 +9805,7 @@ static void test_getdc(void) DDSURFACEDESC surface_desc, map_desc; DDSCAPS caps = {DDSCAPS_COMPLEX}; IDirectDraw *ddraw; - unsigned int i; + unsigned int i, screen_bpp; HWND window; HDC dc, dc2; HRESULT hr; @@ -9869,6 +9869,11 @@ static void test_getdc(void) hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
+ surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDraw_GetDisplayMode(ddraw, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr); + screen_bpp = U1(surface_desc.ddpfPixelFormat).dwRGBBitCount; + for (i = 0; i < ARRAY_SIZE(test_data); ++i) { memset(&surface_desc, 0, sizeof(surface_desc)); @@ -9927,8 +9932,11 @@ static void test_getdc(void) ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount, "Got unexpected bit count %d for format %s.\n", dib.dsBm.bmBitsPixel, test_data[i].name); - ok(!!dib.dsBm.bmBits, "Got unexpected bits %p for format %s.\n", - dib.dsBm.bmBits, test_data[i].name); + /* Windows XP sets bmBits == NULL for formats that match the screen at least on my r200 GPU. I + * suspect this applies to all HW accelerated pre-WDDM drivers because they can handle gdi access + * to ddraw surfaces themselves instead of going through a sysmem DIB section. */ + ok(!!dib.dsBm.bmBits || broken(!pDwmIsCompositionEnabled && dib.dsBm.bmBitsPixel == screen_bpp), + "Got unexpected bits %p for format %s.\n", dib.dsBm.bmBits, test_data[i].name);
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n", dib.dsBmih.biSize, test_data[i].name); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 28e97676456..a14df435b25 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -10507,7 +10507,7 @@ static void test_getdc(void) DDSURFACEDESC surface_desc, map_desc; DDSCAPS caps = {DDSCAPS_COMPLEX}; IDirectDraw2 *ddraw; - unsigned int i; + unsigned int i, screen_bpp; HWND window; HDC dc, dc2; HRESULT hr; @@ -10571,6 +10571,11 @@ static void test_getdc(void) hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
+ surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr); + screen_bpp = U1(surface_desc.ddpfPixelFormat).dwRGBBitCount; + for (i = 0; i < ARRAY_SIZE(test_data); ++i) { memset(&surface_desc, 0, sizeof(surface_desc)); @@ -10629,8 +10634,11 @@ static void test_getdc(void) ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount, "Got unexpected bit count %d for format %s.\n", dib.dsBm.bmBitsPixel, test_data[i].name); - ok(!!dib.dsBm.bmBits, "Got unexpected bits %p for format %s.\n", - dib.dsBm.bmBits, test_data[i].name); + /* Windows XP sets bmBits == NULL for formats that match the screen at least on my r200 GPU. I + * suspect this applies to all HW accelerated pre-WDDM drivers because they can handle gdi access + * to ddraw surfaces themselves instead of going through a sysmem DIB section. */ + ok(!!dib.dsBm.bmBits || broken(!pDwmIsCompositionEnabled && dib.dsBm.bmBitsPixel == screen_bpp), + "Got unexpected bits %p for format %s.\n", dib.dsBm.bmBits, test_data[i].name);
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n", dib.dsBmih.biSize, test_data[i].name); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index b3983468395..b0b70cc2621 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -12488,7 +12488,7 @@ static void test_getdc(void) IDirectDrawSurface4 *surface, *surface2, *tmp; DDSURFACEDESC2 surface_desc, map_desc; IDirectDraw4 *ddraw; - unsigned int i; + unsigned int i, screen_bpp; HWND window; HDC dc, dc2; HRESULT hr; @@ -12552,6 +12552,11 @@ static void test_getdc(void) hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
+ surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDraw4_GetDisplayMode(ddraw, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr); + screen_bpp = U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount; + for (i = 0; i < ARRAY_SIZE(test_data); ++i) { memset(&surface_desc, 0, sizeof(surface_desc)); @@ -12611,8 +12616,11 @@ static void test_getdc(void) ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount, "Got unexpected bit count %d for format %s.\n", dib.dsBm.bmBitsPixel, test_data[i].name); - ok(!!dib.dsBm.bmBits, "Got unexpected bits %p for format %s.\n", - dib.dsBm.bmBits, test_data[i].name); + /* Windows XP sets bmBits == NULL for formats that match the screen at least on my r200 GPU. I + * suspect this applies to all HW accelerated pre-WDDM drivers because they can handle gdi access + * to ddraw surfaces themselves instead of going through a sysmem DIB section. */ + ok(!!dib.dsBm.bmBits || broken(!pDwmIsCompositionEnabled && dib.dsBm.bmBitsPixel == screen_bpp), + "Got unexpected bits %p for format %s.\n", dib.dsBm.bmBits, test_data[i].name);
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n", dib.dsBmih.biSize, test_data[i].name); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 986a1f3a127..b31f942c112 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -12476,7 +12476,7 @@ static void test_getdc(void) IDirectDrawSurface7 *surface, *surface2, *tmp; DDSURFACEDESC2 surface_desc, map_desc; IDirectDraw7 *ddraw; - unsigned int i; + unsigned int i, screen_bpp; HWND window; HDC dc, dc2; HRESULT hr; @@ -12540,6 +12540,11 @@ static void test_getdc(void) hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
+ surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDraw7_GetDisplayMode(ddraw, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr); + screen_bpp = U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount; + for (i = 0; i < ARRAY_SIZE(test_data); ++i) { memset(&surface_desc, 0, sizeof(surface_desc)); @@ -12599,8 +12604,11 @@ static void test_getdc(void) ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount, "Got unexpected bit count %d for format %s.\n", dib.dsBm.bmBitsPixel, test_data[i].name); - ok(!!dib.dsBm.bmBits, "Got unexpected bits %p for format %s.\n", - dib.dsBm.bmBits, test_data[i].name); + /* Windows XP sets bmBits == NULL for formats that match the screen at least on my r200 GPU. I + * suspect this applies to all HW accelerated pre-WDDM drivers because they can handle gdi access + * to ddraw surfaces themselves instead of going through a sysmem DIB section. */ + ok(!!dib.dsBm.bmBits || broken(!pDwmIsCompositionEnabled && dib.dsBm.bmBitsPixel == screen_bpp), + "Got unexpected bits %p for format %s.\n", dib.dsBm.bmBits, test_data[i].name);
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n", dib.dsBmih.biSize, test_data[i].name);
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=63654
Your paranoid android.
=== w8adm (32 bit report) ===
ddraw: ddraw1.c:11122: Test failed: Got unexpected color 0x00ffffff.
=== w864 (64 bit report) ===
ddraw: ddraw2.c:3242: Test failed: Failed to create surface, hr 0x887601c2. 0e24:ddraw2: unhandled exception c0000005 at 000000000046F1C9
=== wvistau64 (32 bit report) ===
ddraw: 0284:ddraw4: unhandled exception c0000005 at 74126143
=== wvistau64 (64 bit report) ===
ddraw: 0910:ddraw4: unhandled exception c0000005 at 000007FEF6301883
=== wvistau64 (32 bit report) ===
ddraw: 0910:ddraw7: unhandled exception c0000005 at 74226143
=== wvistau64 (64 bit report) ===
ddraw: 06e4:ddraw7: unhandled exception c0000005 at 000007FEF6301883
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
The r500 driver on Windows 10 fails the call with DDERR_EXCEPTION. I believe this problem is new on Windows 10, I don't remember seeing it on Win7 on the same hardware. It is probably a side effect of running Win10 with the Win7 driver.
Signed-off-by: Stefan Dösinger stefan@codeweavers.com --- dlls/ddraw/tests/ddraw1.c | 20 ++++++++++++++++++-- dlls/ddraw/tests/ddraw2.c | 24 ++++++++++++++++++++---- dlls/ddraw/tests/ddraw4.c | 20 ++++++++++++++++++-- dlls/ddraw/tests/ddraw7.c | 20 ++++++++++++++++++-- 4 files changed, 74 insertions(+), 10 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index fc104273d02..d85d31343ff 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -5233,7 +5233,7 @@ static void test_pixel_format(void) IDirectDraw *ddraw = NULL; IDirectDrawClipper *clipper = NULL; DDSURFACEDESC ddsd; - IDirectDrawSurface *primary = NULL; + IDirectDrawSurface *primary = NULL, *offscreen; DDBLTFX fx; HRESULT hr;
@@ -5352,20 +5352,36 @@ static void test_pixel_format(void) ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format); }
+ memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + ddsd.dwWidth = ddsd.dwHeight = 64; + hr = IDirectDraw_CreateSurface(ddraw, &ddsd, &offscreen, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); - hr = IDirectDrawSurface_Blt(primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); + hr = IDirectDrawSurface_Blt(offscreen, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc); ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ hr = IDirectDrawSurface_Blt(primary, NULL, offscreen, NULL, DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#x.\n", hr); + + test_format = GetPixelFormat(hdc); + ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format); + if (hdc2) { test_format = GetPixelFormat(hdc2); ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format); }
+ IDirectDrawSurface_Release(offscreen); + cleanup: if (primary) IDirectDrawSurface_Release(primary); if (clipper) IDirectDrawClipper_Release(clipper); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index a14df435b25..9ca6b44eb87 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -6178,7 +6178,7 @@ static void test_pixel_format(void) IDirectDraw2 *ddraw = NULL; IDirectDrawClipper *clipper = NULL; DDSURFACEDESC ddsd; - IDirectDrawSurface *primary = NULL; + IDirectDrawSurface *primary = NULL, *offscreen; DDBLTFX fx; HRESULT hr;
@@ -6287,7 +6287,7 @@ static void test_pixel_format(void)
if (clipper) { - hr = IDirectDrawSurface2_SetClipper(primary, clipper); + hr = IDirectDrawSurface_SetClipper(primary, clipper); ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc); @@ -6297,22 +6297,38 @@ static void test_pixel_format(void) ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format); }
+ memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + ddsd.dwWidth = ddsd.dwHeight = 64; + hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &offscreen, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); - hr = IDirectDrawSurface2_Blt(primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); + hr = IDirectDrawSurface_Blt(offscreen, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc); ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ hr = IDirectDrawSurface_Blt(primary, NULL, offscreen, NULL, DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#x.\n", hr); + + test_format = GetPixelFormat(hdc); + ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format); + if (hdc2) { test_format = GetPixelFormat(hdc2); ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format); }
+ IDirectDrawSurface_Release(offscreen); + cleanup: - if (primary) IDirectDrawSurface2_Release(primary); + if (primary) IDirectDrawSurface_Release(primary); if (clipper) IDirectDrawClipper_Release(clipper); if (ddraw) IDirectDraw2_Release(ddraw); if (gl) FreeLibrary(gl); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index b0b70cc2621..39b4aca6578 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -7994,7 +7994,7 @@ static void test_pixel_format(void) IDirectDraw4 *ddraw = NULL; IDirectDrawClipper *clipper = NULL; DDSURFACEDESC2 ddsd; - IDirectDrawSurface4 *primary = NULL; + IDirectDrawSurface4 *primary = NULL, *offscreen; DDBLTFX fx; HRESULT hr;
@@ -8113,20 +8113,36 @@ static void test_pixel_format(void) ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format); }
+ memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + ddsd.dwWidth = ddsd.dwHeight = 64; + hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &offscreen, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); - hr = IDirectDrawSurface4_Blt(primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); + hr = IDirectDrawSurface4_Blt(offscreen, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc); ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ hr = IDirectDrawSurface4_Blt(primary, NULL, offscreen, NULL, DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#x.\n", hr); + + test_format = GetPixelFormat(hdc); + ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format); + if (hdc2) { test_format = GetPixelFormat(hdc2); ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format); }
+ IDirectDrawSurface4_Release(offscreen); + cleanup: if (primary) IDirectDrawSurface4_Release(primary); if (clipper) IDirectDrawClipper_Release(clipper); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index b31f942c112..2f2ac29a082 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -7836,7 +7836,7 @@ static void test_pixel_format(void) IDirectDraw7 *ddraw = NULL; IDirectDrawClipper *clipper = NULL; DDSURFACEDESC2 ddsd; - IDirectDrawSurface7 *primary = NULL; + IDirectDrawSurface7 *primary = NULL, *offscreen; DDBLTFX fx; HRESULT hr;
@@ -7955,20 +7955,36 @@ static void test_pixel_format(void) ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format); }
+ memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + ddsd.dwWidth = ddsd.dwHeight = 64; + hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &offscreen, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); + memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); - hr = IDirectDrawSurface7_Blt(primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); + hr = IDirectDrawSurface7_Blt(offscreen, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc); ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ hr = IDirectDrawSurface7_Blt(primary, NULL, offscreen, NULL, DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#x.\n", hr); + + test_format = GetPixelFormat(hdc); + ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format); + if (hdc2) { test_format = GetPixelFormat(hdc2); ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format); }
+ IDirectDrawSurface7_Release(offscreen); + cleanup: if (primary) IDirectDrawSurface7_Release(primary); if (clipper) IDirectDrawClipper_Release(clipper);
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=63655
Your paranoid android.
=== w8 (32 bit report) ===
ddraw: ddraw1.c:11138: Test failed: Got unexpected color 0x00ffffff.
=== wvistau64 (32 bit report) ===
ddraw: 0914:ddraw4: unhandled exception c0000005 at 73DE6143
=== wvistau64 (64 bit report) ===
ddraw: 0910:ddraw4: unhandled exception c0000005 at 000007FEF6301883
=== wvistau64 (32 bit report) ===
ddraw: 0914:ddraw7: unhandled exception c0000005 at 73DE6143
=== wvistau64 (64 bit report) ===
ddraw: 06e4:ddraw7: unhandled exception c0000005 at 000007FEF6301883
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
Yes, the driver behavior seems pretty broken, but it is not the point of this test, so I feel placing this workaround is OK. Otherwise the test is passing without any ifs and buts on this card.
I have worked with this card a lot in the past and I don't remember it doing that. I guess it is something specific to the setup of this test - implicit color, transforms on, but lighting off or so.
The actual values it picks vary slightly from test run to test run. Usually the first few tests are non-zero, e.g. 0x00071b4f and the later tests are just 0x00000000. Disabling the other tests in ddraw7 does not change things. The non-zero number varies. --- dlls/ddraw/tests/ddraw7.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 2f2ac29a082..c34d9394861 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -15015,6 +15015,16 @@ static void test_viewport(void) hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+ /* Well, by default the vertices without color info should be white, and without any texture + * ops this should just show up in the output, but the r200 driver begs to differ and draws a + * random color. */ + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TFACTOR); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0x00ffffff); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_SetViewport(device, NULL); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
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=63656
Your paranoid android.
=== wvistau64 (32 bit report) ===
ddraw: 0914:ddraw7: unhandled exception c0000005 at 73DE6143
=== wvistau64 (64 bit report) ===
ddraw: 0914:ddraw7: unhandled exception c0000005 at 000007FEF6301883
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=63652
Your paranoid android.
=== wvistau64 (32 bit report) ===
ddraw: 02d8:ddraw4: unhandled exception c0000005 at 74126143
=== wvistau64 (64 bit report) ===
ddraw: 08d8:ddraw4: unhandled exception c0000005 at 000007FEF6301883
=== w864 (64 bit report) ===
ddraw: ddraw4.c:3479: Test failed: Failed to create surface, hr 0x887601c2. 0140:ddraw4: unhandled exception c0000005 at 00000000004AF023
=== wvistau64 (32 bit report) ===
ddraw: 08d4:ddraw7: unhandled exception c0000005 at 74126143