The added inner loop over attachment chain in the second patch minds zero attachment array only. That is because the only case when non-zero complex_array elements are used is the root of the cube texture.
From: Paul Gofman pgofman@codeweavers.com
--- dlls/ddraw/tests/ddraw1.c | 44 ++++++++++++++++++++++++++++-- dlls/ddraw/tests/ddraw2.c | 44 ++++++++++++++++++++++++++++-- dlls/ddraw/tests/ddraw4.c | 56 +++++++++++++++++++++++++++++++++++++-- dlls/ddraw/tests/ddraw7.c | 56 ++++++++++++++++++++++++++++++++++++--- 4 files changed, 191 insertions(+), 9 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 0d95c95593e..8d5896e45a0 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -7911,8 +7911,8 @@ static void test_palette_alpha(void)
static void test_lost_device(void) { + IDirectDrawSurface *surface, *back_buffer, *back_buffer2, *ds; IDirectDrawSurface *sysmem_surface, *vidmem_surface; - IDirectDrawSurface *surface, *back_buffer; DDSURFACEDESC surface_desc; HWND window1, window2; IDirectDraw *ddraw; @@ -8114,10 +8114,30 @@ static void test_lost_device(void) surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; - surface_desc.dwBackBufferCount = 1; + surface_desc.dwBackBufferCount = 2; hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
+ ds = NULL; + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; + U2(surface_desc).dwZBufferBitDepth = 16; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL); + if (FAILED(hr)) + { + skip("Could not create Z buffer, skipping Z buffer restore test.\n"); + } + else + { + hr = IDirectDrawSurface_AddAttachedSurface(surface, ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + } + hr = IDirectDraw_SetCooperativeLevel(ddraw, window1, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); @@ -8207,6 +8227,7 @@ static void test_lost_device(void)
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); + ok(back_buffer != surface, "Got the same surface.\n"); hr = IDirectDrawSurface_Restore(surface); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer); @@ -8215,6 +8236,25 @@ static void test_lost_device(void) ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(back_buffer);
+ hr = IDirectDrawSurface_GetAttachedSurface(back_buffer, &caps, &back_buffer2); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(back_buffer2 != back_buffer, "Got the same surface.\n"); + ok(back_buffer2 != surface, "Got the same surface.\n"); + hr = IDirectDrawSurface_IsLost(back_buffer2); + todo_wine ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + IDirectDrawSurface_Release(back_buffer2); + + if (ds) + { + hr = IDirectDrawSurface_IsLost(ds); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); + hr = IDirectDrawSurface_Restore(ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDirectDrawSurface_IsLost(ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + IDirectDrawSurface_Release(ds); + } + if (vidmem_surface) IDirectDrawSurface_Release(vidmem_surface); IDirectDrawSurface_Release(sysmem_surface); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 7d38f1758cb..22cd59ec9b0 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -8907,8 +8907,8 @@ static void test_palette_alpha(void)
static void test_lost_device(void) { + IDirectDrawSurface *surface, *back_buffer, *back_buffer2, *ds; IDirectDrawSurface *sysmem_surface, *vidmem_surface; - IDirectDrawSurface *surface, *back_buffer; DDSURFACEDESC surface_desc; HWND window1, window2; IDirectDraw2 *ddraw; @@ -9109,10 +9109,30 @@ static void test_lost_device(void) surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; - surface_desc.dwBackBufferCount = 1; + surface_desc.dwBackBufferCount = 2; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
+ ds = NULL; + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface2_GetSurfaceDesc(surface, &surface_desc); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; + U2(surface_desc).dwZBufferBitDepth = 16; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &ds, NULL); + if (FAILED(hr)) + { + skip("Could not create Z buffer, skipping Z buffer restore test.\n"); + } + else + { + hr = IDirectDrawSurface_AddAttachedSurface(surface, ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + } + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window1, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_IsLost(surface); @@ -9202,6 +9222,7 @@ static void test_lost_device(void)
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); + ok(back_buffer != surface, "Got the same surface.\n"); hr = IDirectDrawSurface_Restore(surface); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer); @@ -9210,6 +9231,25 @@ static void test_lost_device(void) ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(back_buffer);
+ hr = IDirectDrawSurface_GetAttachedSurface(back_buffer, &caps, &back_buffer2); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(back_buffer2 != back_buffer, "Got the same surface.\n"); + ok(back_buffer2 != surface, "Got the same surface.\n"); + hr = IDirectDrawSurface_IsLost(back_buffer2); + todo_wine ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + IDirectDrawSurface_Release(back_buffer2); + + if (ds) + { + hr = IDirectDrawSurface_IsLost(ds); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); + hr = IDirectDrawSurface_Restore(ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDirectDrawSurface_IsLost(ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + IDirectDrawSurface_Release(ds); + } + if (vidmem_surface) IDirectDrawSurface_Release(vidmem_surface); IDirectDrawSurface_Release(sysmem_surface); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index db1b6b35ebe..c1bd91dec88 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -10274,11 +10274,14 @@ static void test_vb_writeonly(void)
static void test_lost_device(void) { + IDirectDrawSurface4 *surface, *back_buffer, *back_buffer2, *ds; IDirectDrawSurface4 *sysmem_surface, *vidmem_surface; - IDirectDrawSurface4 *surface, *back_buffer; DDSURFACEDESC2 surface_desc; HWND window1, window2; IDirectDraw4 *ddraw; + DDPIXELFORMAT z_fmt; + IDirect3D3 *d3d; + ULONG refcount; DDSCAPS2 caps; HRESULT hr; @@ -10503,10 +10506,39 @@ static void test_lost_device(void) surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; - U5(surface_desc).dwBackBufferCount = 1; + U5(surface_desc).dwBackBufferCount = 2; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
+ + ds = NULL; + hr = IDirectDraw4_QueryInterface(ddraw, &IID_IDirect3D3, (void **)&d3d); + if (hr == S_OK) + { + memset(&z_fmt, 0, sizeof(z_fmt)); + hr = IDirect3D3_EnumZBufferFormats(d3d, &IID_IDirect3DHALDevice, enum_z_fmt, &z_fmt); + if (FAILED(hr) || !z_fmt.dwSize) + { + skip("No depth buffer formats available, skipping Z buffer restore test.\n"); + } + else + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &surface_desc); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; + U4(surface_desc).ddpfPixelFormat = z_fmt; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &ds, NULL); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + + hr = IDirectDrawSurface_AddAttachedSurface(surface, ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + } + IDirect3D3_Release(d3d); + } hr = IDirectDraw4_SetCooperativeLevel(ddraw, window1, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw4_TestCooperativeLevel(ddraw); @@ -10613,10 +10645,30 @@ static void test_lost_device(void) ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &back_buffer); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(back_buffer != surface, "Got the same surface.\n"); hr = IDirectDrawSurface4_IsLost(back_buffer); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface4_Release(back_buffer);
+ hr = IDirectDrawSurface4_GetAttachedSurface(back_buffer, &caps, &back_buffer2); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(back_buffer2 != back_buffer, "Got the same surface.\n"); + ok(back_buffer2 != surface, "Got the same surface.\n"); + hr = IDirectDrawSurface4_IsLost(back_buffer2); + todo_wine ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + IDirectDrawSurface4_Release(back_buffer2); + + if (ds) + { + hr = IDirectDrawSurface4_IsLost(ds); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); + hr = IDirectDrawSurface4_Restore(ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDirectDrawSurface4_IsLost(ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + IDirectDrawSurface4_Release(ds); + } + if (vidmem_surface) IDirectDrawSurface4_Release(vidmem_surface); IDirectDrawSurface4_Release(sysmem_surface); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index b365d9a00df..8ea566cee4c 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -10024,11 +10024,13 @@ static void test_vb_writeonly(void)
static void test_lost_device(void) { + IDirectDrawSurface7 *surface, *back_buffer, *back_buffer2, *ds; IDirectDrawSurface7 *sysmem_surface, *vidmem_surface; - IDirectDrawSurface7 *surface, *back_buffer; DDSURFACEDESC2 surface_desc; HWND window1, window2; IDirectDraw7 *ddraw; + DDPIXELFORMAT z_fmt; + IDirect3D7 *d3d; ULONG refcount; DDSCAPS2 caps; HRESULT hr; @@ -10255,10 +10257,39 @@ static void test_lost_device(void) surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; - U5(surface_desc).dwBackBufferCount = 1; + U5(surface_desc).dwBackBufferCount = 2; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
+ ds = NULL; + hr = IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d); + if (hr == S_OK) + { + memset(&z_fmt, 0, sizeof(z_fmt)); + hr = IDirect3D7_EnumZBufferFormats(d3d, &IID_IDirect3DHALDevice, enum_z_fmt, &z_fmt); + if (FAILED(hr) || !z_fmt.dwSize) + { + skip("No depth buffer formats available, skipping Z buffer restore test.\n"); + } + else + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; + U4(surface_desc).ddpfPixelFormat = z_fmt; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &ds, NULL); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + + hr = IDirectDrawSurface7_AddAttachedSurface(surface, ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + } + IDirect3D7_Release(d3d); + } + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window1, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDraw7_TestCooperativeLevel(ddraw); @@ -10364,11 +10395,30 @@ static void test_lost_device(void) ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &back_buffer); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(back_buffer != surface, "Got the same surface.\n"); hr = IDirectDrawSurface7_IsLost(back_buffer); ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); - IDirectDrawSurface7_Release(back_buffer);
+ hr = IDirectDrawSurface7_GetAttachedSurface(back_buffer, &caps, &back_buffer2); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(back_buffer2 != back_buffer, "Got the same surface.\n"); + ok(back_buffer2 != surface, "Got the same surface.\n"); + hr = IDirectDrawSurface7_IsLost(back_buffer2); + todo_wine ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + IDirectDrawSurface7_Release(back_buffer2); + + if (ds) + { + hr = IDirectDrawSurface7_IsLost(ds); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr); + hr = IDirectDrawSurface7_Restore(ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDirectDrawSurface7_IsLost(ds); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + IDirectDrawSurface7_Release(ds); + } + if (vidmem_surface) IDirectDrawSurface7_Release(vidmem_surface); IDirectDrawSurface7_Release(sysmem_surface);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=121273
Your paranoid android.
=== w1064v1507 (32 bit report) ===
ddraw: ddraw7.c:18938: Test failed: Got unexpected color 0x00000040.
=== debian11 (32 bit Chinese:China report) ===
Report validation errors: ddraw7: Timeout
=== debian11 (build log) ===
WineRunWineTest.pl:error: The task timed out
From: Paul Gofman pgofman@codeweavers.com
--- dlls/ddraw/surface.c | 12 ++++++++++-- dlls/ddraw/tests/ddraw1.c | 2 +- dlls/ddraw/tests/ddraw2.c | 2 +- dlls/ddraw/tests/ddraw4.c | 2 +- dlls/ddraw/tests/ddraw7.c | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index afba0d5ac4b..038539632e1 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -3787,6 +3787,7 @@ static HRESULT WINAPI ddraw_surface1_IsLost(IDirectDrawSurface *iface) static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); + struct ddraw_surface *attachment; unsigned int i;
TRACE("iface %p.\n", iface); @@ -3832,10 +3833,17 @@ static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface) return DDERR_WRONGMODE;
surface->is_lost = FALSE; + for(i = 0; i < MAX_COMPLEX_ATTACHED; i++) { - if (surface->complex_array[i]) - surface->complex_array[i]->is_lost = FALSE; + attachment = surface->complex_array[i]; + while (attachment) + { + attachment->is_lost = FALSE; + attachment = attachment->complex_array[0]; + if (attachment == surface->complex_array[i]) + break; + } }
return DD_OK; diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 8d5896e45a0..1629660aedc 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -8241,7 +8241,7 @@ static void test_lost_device(void) ok(back_buffer2 != back_buffer, "Got the same surface.\n"); ok(back_buffer2 != surface, "Got the same surface.\n"); hr = IDirectDrawSurface_IsLost(back_buffer2); - todo_wine ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(back_buffer2);
if (ds) diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 22cd59ec9b0..0aea1587156 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -9236,7 +9236,7 @@ static void test_lost_device(void) ok(back_buffer2 != back_buffer, "Got the same surface.\n"); ok(back_buffer2 != surface, "Got the same surface.\n"); hr = IDirectDrawSurface_IsLost(back_buffer2); - todo_wine ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface_Release(back_buffer2);
if (ds) diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index c1bd91dec88..ab37adc000a 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -10655,7 +10655,7 @@ static void test_lost_device(void) ok(back_buffer2 != back_buffer, "Got the same surface.\n"); ok(back_buffer2 != surface, "Got the same surface.\n"); hr = IDirectDrawSurface4_IsLost(back_buffer2); - todo_wine ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface4_Release(back_buffer2);
if (ds) diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 8ea566cee4c..c72ea64c17d 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -10405,7 +10405,7 @@ static void test_lost_device(void) ok(back_buffer2 != back_buffer, "Got the same surface.\n"); ok(back_buffer2 != surface, "Got the same surface.\n"); hr = IDirectDrawSurface7_IsLost(back_buffer2); - todo_wine ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); IDirectDrawSurface7_Release(back_buffer2);
if (ds)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=121274
Your paranoid android.
=== w864 (32 bit report) ===
ddraw: ddraw7.c:18938: Test failed: Got unexpected color 0x00000040.
=== debian11 (32 bit Chinese:China report) ===
Report validation errors: ddraw7: Timeout
=== debian11 (build log) ===
WineRunWineTest.pl:error: The task timed out
From patch 2/2: ```diff @@ -3832,10 +3833,17 @@ static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface) return DDERR_WRONGMODE;
surface->is_lost = FALSE; + for(i = 0; i < MAX_COMPLEX_ATTACHED; i++) { - if (surface->complex_array[i]) - surface->complex_array[i]->is_lost = FALSE; + attachment = surface->complex_array[i]; + while (attachment) + { + attachment->is_lost = FALSE; + attachment = attachment->complex_array[0]; + if (attachment == surface->complex_array[i]) + break; + } }
return DD_OK;
```
Does that do the right thing? I don't think that iterates over any surfaces it previously didn't. I'd expect an `attachment = attachment->next_attached` somewhere in there.
On 16 Aug 2022, at 07:10, Henri Verbeet (@hverbeet) wine@gitlab.winehq.org wrote:
From patch 2/2:
@@ -3832,10 +3833,17 @@ static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface) return DDERR_WRONGMODE; surface->is_lost = FALSE; + for(i = 0; i < MAX_COMPLEX_ATTACHED; i++) { - if (surface->complex_array[i]) - surface->complex_array[i]->is_lost = FALSE; + attachment = surface->complex_array[i]; + while (attachment) + { + attachment->is_lost = FALSE; + attachment = attachment->complex_array[0]; + if (attachment == surface->complex_array[i]) + break; + } } return DD_OK;
Does that do the right thing? I don't think that iterates over any surfaces it previously didn't. I'd expect an `attachment = attachment->next_attached` somewhere in there.
I think it does iterates over more surfaces with this change, in particular, more than one flippable surface.
Multiple backbuffers and mip levels form a chain through complex_array[0] (with other complex array elements used by head cube texture surface only). Without the change only the first after head was restored.
The surfaces attached explicitly by the app go to next_attached.
My test adds todo_wine which is removed with the change. I also added a test with attached Z buffer which suggests we should not iterate over next_attached, at least not in a generic case.
Does that do the right thing? I don't think that iterates over any surfaces it previously didn't. I'd expect an `attachment = attachment->next_attached` somewhere in there.
I think it does iterates over more surfaces with this change, in particular, more than one flippable surface.
Multiple backbuffers and mip levels form a chain through complex_array[0] (with other complex array elements used by head cube texture surface only). Without the change only the first after head was restored.
You're right, of course. The `complex_array[]` construction isn't entirely intuitive; wouldn't be the first time it trips me up. :-\
The surfaces attached explicitly by the app go to next_attached.
My test adds todo_wine which is removed with the change. I also added a test with attached Z buffer which suggests we should not iterate over next_attached, at least not in a generic case.
Slightly odd, but well, ddraw.
This merge request was approved by Jan Sikorski.