This series fixes a few bugs in the d3d tests that cause them to crash on my Windows XP laptop with the r200 GPU (dx8 era).
There are plenty more problems on this GPU on Windows. d3d8:visual hangs the entire system. d3d9:device has some failing tests. d3d9:visual crashes, which is probably good because otherwise it would also cause a kernel panic.
From: Stefan Dösinger stefan@codeweavers.com
--- dlls/d3d9/tests/device.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 8284e3365c8..197506f6bfd 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -3172,10 +3172,14 @@ static void test_draw_primitive(void) hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLELIST, 0, 2); ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#lx.\n", hr);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 2, quad, 0); - ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, quad, 0); - ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr); + /* Crashes on r200, Windows XP with STATUS_INTEGER_DIVIDE_BY_ZERO. */ + if (0) + { + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 2, quad, 0); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, quad, 0); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr); + }
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 2, quad, sizeof(*quad)); ok(SUCCEEDED(hr), "DrawPrimitiveUP failed, hr %#lx.\n", hr); @@ -3205,12 +3209,16 @@ static void test_draw_primitive(void) ok(current_ib == index_buffer, "Unexpected index buffer %p.\n", current_ib); IDirect3DIndexBuffer9_Release(current_ib);
- hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2, - indices, D3DFMT_INDEX16, quad, 0); - ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 0, - indices, D3DFMT_INDEX16, quad, 0); - ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr); + /* Crashes on r200, Windows XP with STATUS_INTEGER_DIVIDE_BY_ZERO. */ + if (0) + { + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2, + indices, D3DFMT_INDEX16, quad, 0); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 0, + indices, D3DFMT_INDEX16, quad, 0); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr); + }
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2, indices, D3DFMT_INDEX16, quad, sizeof(*quad));
From: Stefan Dösinger stefan@codeweavers.com
--- dlls/d3d8/tests/device.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index ec6f2ce51b3..21d0c7ebbce 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -10323,8 +10323,12 @@ static void test_draw_primitive(void) ok(stride == sizeof(*quad), "Unexpected stride %u.\n", stride); IDirect3DVertexBuffer8_Release(current_vb);
- hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, quad, 0); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr %#lx.\n", hr); + /* Crashes on r200, Windows XP with STATUS_INTEGER_DIVIDE_BY_ZERO. */ + if (0) + { + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, quad, 0); + ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr %#lx.\n", hr); + } hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, quad, sizeof(*quad)); ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr %#lx.\n", hr);
@@ -10354,12 +10358,16 @@ static void test_draw_primitive(void) ok(base_vertex_index == 1, "Unexpected base vertex index %u.\n", base_vertex_index); IDirect3DIndexBuffer8_Release(current_ib);
- hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 0, - indices, D3DFMT_INDEX16, quad, 0); - ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#lx.\n", hr); - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2, - indices, D3DFMT_INDEX16, quad, 0); - ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#lx.\n", hr); + /* Crashes on r200, Windows XP with STATUS_INTEGER_DIVIDE_BY_ZERO. */ + if (0) + { + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 0, + indices, D3DFMT_INDEX16, quad, 0); + ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#lx.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2, + indices, D3DFMT_INDEX16, quad, 0); + ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#lx.\n", hr); + }
hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2, indices, D3DFMT_INDEX16, quad, sizeof(*quad));
From: Stefan Dösinger stefan@codeweavers.com
I don't think it is necessary and it isn't supported on r200. Because we create it without a specified level count, the skip() doesn't get triggered and we crash when we try to retrieve the surface. --- dlls/d3d9/tests/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 197506f6bfd..3e04f34b6d4 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -9078,7 +9078,7 @@ static void test_getdc(void) if (!testdata[i].getdc_supported) continue;
- if (FAILED(hr = IDirect3DDevice9_CreateCubeTexture(device, 64, 0, 0, + if (FAILED(hr = IDirect3DDevice9_CreateCubeTexture(device, 64, 1, 0, testdata[i].format, D3DPOOL_MANAGED, &cube_texture, NULL))) { skip("Failed to create cube texture for format %s (hr %#lx), skipping tests.\n", testdata[i].name, hr); @@ -9087,7 +9087,7 @@ static void test_getdc(void)
hr = IDirect3DCubeTexture9_GetCubeMapSurface(cube_texture, D3DCUBEMAP_FACE_POSITIVE_X, 0, &surface); ok(SUCCEEDED(hr), "Failed to get cube surface for format %s, hr %#lx.\n", testdata[i].name, hr); - hr = IDirect3DCubeTexture9_GetCubeMapSurface(cube_texture, D3DCUBEMAP_FACE_NEGATIVE_Y, 2, &surface2); + hr = IDirect3DCubeTexture9_GetCubeMapSurface(cube_texture, D3DCUBEMAP_FACE_NEGATIVE_Y, 0, &surface2); ok(SUCCEEDED(hr), "Failed to get cube surface for format %s, hr %#lx.\n", testdata[i].name, hr);
hr = IDirect3DSurface9_GetDC(surface, &dc);
From: Stefan Dösinger stefan@codeweavers.com
--- dlls/d3d8/tests/device.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 21d0c7ebbce..5747880b4d2 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -9721,6 +9721,7 @@ static void test_resource_access(void) D3DADAPTER_IDENTIFIER8 identifier; struct device_desc device_desc; D3DSURFACE_DESC surface_desc; + BOOL skip_ati2n_once = FALSE; IDirect3DDevice8 *device; unsigned int i, j; IDirect3D8 *d3d; @@ -9872,7 +9873,11 @@ static void test_resource_access(void) if (tests[j].format == FORMAT_ATI2 && FAILED(IDirect3D8_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, format))) { - skip("ATI2N texture not supported.\n"); + if (!skip_ati2n_once) + { + skip("ATI2N texture not supported.\n"); + skip_ati2n_once = TRUE; + } continue; }
@@ -10028,6 +10033,17 @@ static void test_resource_access(void) else format = colour_format;
+ if (tests[i].format == FORMAT_ATI2 && FAILED(IDirect3D8_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, D3DRTYPE_VOLUMETEXTURE, format))) + { + if (!skip_ati2n_once) + { + skip("ATI2N texture not supported.\n"); + skip_ati2n_once = TRUE; + } + continue; + } + hr = IDirect3DDevice8_CreateVolumeTexture(device, 16, 16, 1, 1, tests[i].usage, format, tests[i].pool, &texture); ok((hr == ((!(tests[i].usage & ~D3DUSAGE_DYNAMIC) && tests[i].format != FORMAT_ATI2)
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=137126
Your paranoid android.
=== w10pro64_ja (64 bit report) ===
d3d9: device.c:12120: Test failed: Got unexpected hr 0x88760868. device.c:12540: Test failed: Got unexpected hr 0x8876086c. device.c:12543: Test failed: Got unexpected hr 0x8876086c. device.c:12552: Test failed: Got unexpected hr 0x8876086c. device.c:12563: Test failed: Got unexpected hr 0x8876086c. device.c:12552: Test failed: Got unexpected hr 0x8876086c. device.c:12563: Test failed: Got unexpected hr 0x8876086c. device.c:12552: Test failed: Got unexpected hr 0x8876086c. device.c:12563: Test failed: Got unexpected hr 0x8876086c. device.c:12552: Test failed: Got unexpected hr 0x8876086c. device.c:12563: Test failed: Got unexpected hr 0x8876086c. device.c:12552: Test failed: Got unexpected hr 0x8876086c. device.c:12563: Test failed: Got unexpected hr 0x8876086c. device.c:12552: Test failed: Got unexpected hr 0x8876086c. device.c:12563: Test failed: Got unexpected hr 0x8876086c. device.c:12552: Test failed: Got unexpected hr 0x8876086c. device.c:12563: Test failed: Got unexpected hr 0x8876086c. device.c:12552: Test failed: Got unexpected hr 0x8876086c. device.c:12563: Test failed: Got unexpected hr 0x8876086c. device.c:12552: Test failed: Got unexpected hr 0x8876086c. device.c:12563: Test failed: Got unexpected hr 0x8876086c.
I can't help feeling like there's value in having tests for GetDC() on mip levels. Maybe we could independently test a cube texture and a mipmapped 2D texture?
This merge request was approved by Zebediah Figura.
After an IRC discussion I'll change the mip level handling - explicitly request a cube texture with mip levels to skip the test on old boxes.