Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46807
According to the logs attached to the bug, the application seems to spin in endless LIST_FOR_EACH_ENTRY() in viewport_activate(), which is the result of adding the same light structure to the list twice.
Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/ddraw/tests/ddraw4.c | 27 +++++++++++++++++---------- dlls/ddraw/viewport.c | 7 +++++++ 2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index b60606fca3..a930c91be1 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -4051,21 +4051,21 @@ static void test_lighting(void) {&mat_nonaffine, translatedquad, 0x000000ff, "Lit quad with non-affine matrix"}, };
- HWND window; - IDirect3D3 *d3d; + DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL; + IDirect3DViewport3 *viewport, *viewport2; + DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE; + IDirect3DMaterial3 *material; + D3DMATERIALHANDLE mat_handle; IDirect3DDevice3 *device; IDirectDrawSurface4 *rt; - IDirect3DViewport3 *viewport; - IDirect3DMaterial3 *material; IDirect3DLight *light; - D3DMATERIALHANDLE mat_handle; D3DLIGHT2 light_desc; - HRESULT hr; - DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE; - DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL; + IDirect3D3 *d3d; D3DCOLOR color; ULONG refcount; unsigned int i; + HWND window; + HRESULT hr;
window = create_window(); if (!(device = create_device(window, DDSCL_NORMAL))) @@ -4160,9 +4160,16 @@ static void test_lighting(void) U4(light_desc.dcvColor).a = 1.0f; U3(light_desc.dvDirection).z = 1.0f; hr = IDirect3DLight_SetLight(light, (D3DLIGHT *)&light_desc); - ok(SUCCEEDED(hr), "Failed to set light, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DViewport3_AddLight(viewport, light); - ok(SUCCEEDED(hr), "Failed to add a light to the viewport, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport3_AddLight(viewport, light); + ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr); + + viewport2 = create_viewport(device, 0, 0, 640, 480); + hr = IDirect3DViewport3_AddLight(viewport2, light); + ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr); + IDirect3DViewport3_Release(viewport2);
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c index 78a2fde6f3..e7e4463511 100644 --- a/dlls/ddraw/viewport.c +++ b/dlls/ddraw/viewport.c @@ -760,6 +760,13 @@ static HRESULT WINAPI d3d_viewport_AddLight(IDirect3DViewport3 *iface, IDirect3D return DDERR_INVALIDPARAMS; }
+ if (light_impl->active_viewport) + { + wined3d_mutex_unlock(); + WARN("Light %p is active in viewport %p.\n", light_impl, light_impl->active_viewport); + return D3DERR_LIGHTHASVIEWPORT; + } + /* Find a light number and update both light and viewports objects accordingly */ while (map & 1) {
Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/ddraw/tests/ddraw2.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 37238e162f..35a1be49cb 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -7048,20 +7048,20 @@ static void test_lighting(void) {&mat_nonaffine, translatedquad, 0x000000ff, "Lit quad with non-affine matrix"}, };
- HWND window; - IDirect3D2 *d3d; + IDirect3DViewport2 *viewport, *viewport2; + D3DMATERIALHANDLE mat_handle; + IDirect3DMaterial2 *material; IDirect3DDevice2 *device; - IDirectDraw2 *ddraw; IDirectDrawSurface *rt; - IDirect3DViewport2 *viewport; - IDirect3DMaterial2 *material; IDirect3DLight *light; - D3DMATERIALHANDLE mat_handle; D3DLIGHT2 light_desc; - HRESULT hr; + IDirectDraw2 *ddraw; + IDirect3D2 *d3d; D3DCOLOR color; ULONG refcount; unsigned int i; + HWND window; + HRESULT hr;
window = create_window(); ddraw = create_ddraw(); @@ -7158,9 +7158,16 @@ static void test_lighting(void) U4(light_desc.dcvColor).a = 1.0f; U3(light_desc.dvDirection).z = 1.0f; hr = IDirect3DLight_SetLight(light, (D3DLIGHT *)&light_desc); - ok(SUCCEEDED(hr), "Failed to set light, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DViewport2_AddLight(viewport, light); - ok(SUCCEEDED(hr), "Failed to add a light to the viewport, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport2_AddLight(viewport, light); + ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr); + + viewport2 = create_viewport(device, 0, 0, 640, 480); + hr = IDirect3DViewport2_AddLight(viewport2, light); + ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr); + destroy_viewport(device, viewport2);
hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); ok(SUCCEEDED(hr), "Failed to clear viewport, 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=49751
Your paranoid android.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9b (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/ddraw/tests/ddraw1.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index d0ed33dbc4..fbe1bcb855 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -6029,25 +6029,25 @@ static void test_lighting(void) {&mat_nonaffine, translatedquad, 0x000000ff, "Lit quad with non-affine matrix"}, };
- HWND window; - IDirect3D *d3d; - IDirect3DDevice *device; - IDirectDraw *ddraw; - IDirectDrawSurface *rt; - IDirect3DViewport *viewport; - IDirect3DMaterial *material; - IDirect3DLight *light; + D3DMATRIXHANDLE world_handle, view_handle, proj_handle; + IDirect3DViewport *viewport, *viewport2; IDirect3DExecuteBuffer *execute_buffer; D3DEXECUTEBUFFERDESC exec_desc; D3DMATERIALHANDLE mat_handle; - D3DMATRIXHANDLE world_handle, view_handle, proj_handle; + IDirect3DMaterial *material; + IDirect3DDevice *device; + IDirectDrawSurface *rt; + IDirect3DLight *light; D3DLIGHT light_desc; - HRESULT hr; - D3DCOLOR color; - void *ptr; + IDirectDraw *ddraw; UINT inst_length; ULONG refcount; unsigned int i; + IDirect3D *d3d; + D3DCOLOR color; + HWND window; + HRESULT hr; + void *ptr;
window = create_window(); ddraw = create_ddraw(); @@ -6202,9 +6202,16 @@ static void test_lighting(void) U4(light_desc.dcvColor).a = 1.0f; U3(light_desc.dvDirection).z = 1.0f; hr = IDirect3DLight_SetLight(light, &light_desc); - ok(SUCCEEDED(hr), "Failed to set light, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DViewport_AddLight(viewport, light); - ok(SUCCEEDED(hr), "Failed to add a light to the viewport, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport_AddLight(viewport, light); + ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr); + + viewport2 = create_viewport(device, 0, 0, 640, 480); + hr = IDirect3DViewport_AddLight(viewport2, light); + ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr); + destroy_viewport(device, viewport2);
for (i = 0; i < ARRAY_SIZE(tests); ++i) {
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=49752
Your paranoid android.
=== w8adm (32 bit report) ===
ddraw: ddraw1.c:10601: Test failed: Got unexpected color 0x00ffffff.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9b (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
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=49750
Your paranoid android.
=== wvistau64_he (32 bit report) ===
ddraw: ddraw4.c:3045: Test failed: Expected message 0x46, but didn't receive it. ddraw4.c:3047: Test failed: Expected screen size 1024x768, got 0x0. ddraw4.c:3053: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3083: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3090: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3116: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3139: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3161: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3187: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3207: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3243: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3253: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3279: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3302: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3324: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3350: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3370: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3407: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746).
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9b (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)