As a regression test for bug 48072.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ddraw/tests/ddraw4.c | 28 ++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw7.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+)
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index e3146ca45d0..a29dec02d93 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -1117,6 +1117,19 @@ static void test_coop_level_d3d_state(void) HWND window; HRESULT hr;
+ static struct + { + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.0f}, 0x800000ff}, + {{-1.0f, 1.0f, 0.0f}, 0x800000ff}, + {{ 1.0f, -1.0f, 0.0f}, 0x800000ff}, + {{ 1.0f, 1.0f, 0.0f}, 0x800000ff}, + }; + window = create_window(); if (!(device = create_device(window, DDSCL_NORMAL))) { @@ -1127,6 +1140,11 @@ static void test_coop_level_d3d_state(void)
viewport = create_viewport(device, 0, 0, 640, 480);
+ hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_DESTALPHA); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_GetRenderTarget(device, &rt); ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); hr = IDirect3DDevice3_GetRenderState(device, D3DRENDERSTATE_ZENABLE, &value); @@ -1169,6 +1187,16 @@ static void test_coop_level_d3d_state(void) color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color);
+ hr = IDirect3DDevice3_BeginScene(device); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZ | D3DFVF_DIFFUSE, quad, ARRAY_SIZE(quad), 0); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_EndScene(device); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + todo_wine ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color); + destroy_viewport(device, viewport); IDirectDrawSurface4_Release(surface); IDirectDrawSurface4_Release(rt); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 2cd3b516f14..2e06844ed55 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -1002,6 +1002,19 @@ static void test_coop_level_d3d_state(void) HWND window; HRESULT hr;
+ static struct + { + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.0f}, 0x800000ff}, + {{-1.0f, 1.0f, 0.0f}, 0x800000ff}, + {{ 1.0f, -1.0f, 0.0f}, 0x800000ff}, + {{ 1.0f, 1.0f, 0.0f}, 0x800000ff}, + }; + window = create_window(); if (!(device = create_device(window, DDSCL_NORMAL))) { @@ -1010,6 +1023,13 @@ static void test_coop_level_d3d_state(void) return; }
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_DESTALPHA); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_GetRenderTarget(device, &rt); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_ZENABLE, &value); @@ -1071,6 +1091,16 @@ static void test_coop_level_d3d_state(void) color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color);
+ hr = IDirect3DDevice7_BeginScene(device); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZ | D3DFVF_DIFFUSE, quad, ARRAY_SIZE(quad), 0); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_EndScene(device); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + todo_wine ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color); + IDirectDrawSurface7_Release(surface); IDirectDrawSurface7_Release(rt); IDirect3DDevice7_Release(device);
Fixes a regression introduced by 96547e622b04f403bc0c78d649275d1f844ed40e.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48072 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ddraw/tests/ddraw4.c | 2 +- dlls/ddraw/tests/ddraw7.c | 2 +- dlls/wined3d/device.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index a29dec02d93..8e29b2ca9c2 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -1195,7 +1195,7 @@ static void test_coop_level_d3d_state(void) hr = IDirect3DDevice3_EndScene(device); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); color = get_surface_color(rt, 320, 240); - todo_wine ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color); + ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color);
destroy_viewport(device, viewport); IDirectDrawSurface4_Release(surface); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 2e06844ed55..0462ef1e734 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -1099,7 +1099,7 @@ static void test_coop_level_d3d_state(void) hr = IDirect3DDevice7_EndScene(device); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); color = get_surface_color(rt, 320, 240); - todo_wine ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color); + ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color);
IDirectDrawSurface7_Release(surface); IDirectDrawSurface7_Release(rt); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 2a4d3778486..baf9f25e98d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1142,6 +1142,8 @@ void wined3d_device_uninit_3d(struct wined3d_device *device)
wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); + memset(&device->state, 0, sizeof(device->state)); + state_init(&device->state, &device->fb, &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT); for (i = 0; i < device->adapter->d3d_info.limits.max_rt_count; ++i) { wined3d_device_set_rendertarget_view(device, i, NULL, FALSE);
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=60232
Your paranoid android.
=== w8 (32 bit report) ===
ddraw: 0e98:ddraw4: unhandled exception c0000005 at 69F3F3F3
=== w8adm (32 bit report) ===
ddraw: 0d08:ddraw4: unhandled exception c0000005 at 69A4F3F3
=== w864 (32 bit report) ===
ddraw: 0710:ddraw4: unhandled exception c0000005 at 73FBF3F3
=== w1064v1507 (32 bit report) ===
ddraw: 0c84:ddraw4: unhandled exception c0000005 at 730A284D
=== w1064v1809 (32 bit report) ===
ddraw: 19d0:ddraw4: unhandled exception c0000005 at 748716F2
=== w1064v1809_2scr (32 bit report) ===
ddraw: 1ac8:ddraw4: unhandled exception c0000005 at 73A016F2
=== w1064v1809_ar (32 bit report) ===
ddraw: 15e4:ddraw4: unhandled exception c0000005 at 72B716F2
=== w1064v1809_he (32 bit report) ===
ddraw: 1998:ddraw4: unhandled exception c0000005 at 73C216F2
=== w1064v1809_ja (32 bit report) ===
ddraw: 1b4c:ddraw4: unhandled exception c0000005 at 722016F2
=== w1064v1809_zh_CN (32 bit report) ===
ddraw: 1b8c:ddraw4: unhandled exception c0000005 at 732D16F2
=== w1064v1809 (32 bit report) ===
ddraw: 1974:ddraw7: unhandled exception c0000005 at 732F40F8
=== w1064v1809_2scr (32 bit report) ===
ddraw: 19fc:ddraw7: unhandled exception c0000005 at 74C540F8
=== w1064v1809_ar (32 bit report) ===
ddraw: 1818:ddraw7: unhandled exception c0000005 at 712540F8
=== w1064v1809_he (32 bit report) ===
ddraw: 1aa8:ddraw7: unhandled exception c0000005 at 738040F8
=== w1064v1809_ja (32 bit report) ===
ddraw: 1be0:ddraw7: unhandled exception c0000005 at 723740F8
=== w1064v1809_zh_CN (32 bit report) ===
ddraw: 1a6c:ddraw7: unhandled exception c0000005 at 733440F8
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=60231
Your paranoid android.
=== w8 (32 bit report) ===
ddraw: 0ee8:ddraw4: unhandled exception c0000005 at 69D6F3F3
=== w8adm (32 bit report) ===
ddraw: 0d8c:ddraw4: unhandled exception c0000005 at 69A3F3F3
=== w864 (32 bit report) ===
ddraw: 0798:ddraw4: unhandled exception c0000005 at 74B2F3F3
=== w1064v1507 (32 bit report) ===
ddraw: 0c80:ddraw4: unhandled exception c0000005 at 730A284D
=== w1064v1809 (32 bit report) ===
ddraw: 1910:ddraw4: unhandled exception c0000005 at 73FD16F2
=== w1064v1809_2scr (32 bit report) ===
ddraw: 1aec:ddraw4: unhandled exception c0000005 at 720D16F2
=== w1064v1809_ar (32 bit report) ===
ddraw: 1878:ddraw4: unhandled exception c0000005 at 72B716F2
=== w1064v1809_he (32 bit report) ===
ddraw: 1928:ddraw4: unhandled exception c0000005 at 736616F2
=== w1064v1809_ja (32 bit report) ===
ddraw: 1ab8:ddraw4: unhandled exception c0000005 at 722316F2
=== w1064v1809_zh_CN (32 bit report) ===
ddraw: 1b90:ddraw4: unhandled exception c0000005 at 732D16F2
=== w1064v1809 (32 bit report) ===
ddraw: 1a54:ddraw7: unhandled exception c0000005 at 72B440F8
=== w1064v1809_2scr (32 bit report) ===
ddraw: 1a5c:ddraw7: unhandled exception c0000005 at 733240F8
=== w1064v1809_ar (32 bit report) ===
ddraw: 11dc:ddraw7: unhandled exception c0000005 at 726C40F8
=== w1064v1809_he (32 bit report) ===
ddraw: 1ad4:ddraw7: unhandled exception c0000005 at 737D40F8
=== w1064v1809_ja (32 bit report) ===
ddraw: 1af4:ddraw7: unhandled exception c0000005 at 71D140F8
=== w1064v1809_zh_CN (32 bit report) ===
ddraw: 1a70:ddraw7: unhandled exception c0000005 at 734440F8