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.
-- v2: d3d9/tests: Fix skipping ATI2N in test_resource_access. d3d8/tests: Fix skipping ATI2N in test_resource_access. d3d9/tests: Request a 3 mip level cube texture in test_getdc(). d3d8/tests: Zero stride tests crash on Windows XP, r200 GPU. d3d9/tests: Zero stride tests crash on Windows XP, r200 GPU.
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 c972e97f572..2347841b66f 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 b61ad207cc9..e915272b870 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -10329,8 +10329,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);
@@ -10360,12 +10364,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
If we let d3d9 decide we get a single-level texture on HW that does not support mipmapped cubes, e.g. r200 GPUs. By explicitly requesting the 3 levels we need we'll skip the test.
The test demonstrates that only one subresource can be locked / have a DC, so it makes sense to show that this applies to the whole texture and not just one level. --- dlls/d3d9/tests/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 2347841b66f..85d72fff8f7 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -9113,7 +9113,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, 3, 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);
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 e915272b870..ae7d3b28a10 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -9727,6 +9727,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; @@ -9878,7 +9879,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; }
@@ -10034,6 +10039,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)
From: Stefan Dösinger stefan@codeweavers.com
--- dlls/d3d9/tests/device.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 85d72fff8f7..a90e6a3a7a4 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -13584,6 +13584,7 @@ static void test_resource_access(void) D3DADAPTER_IDENTIFIER9 identifier; struct device_desc device_desc; D3DSURFACE_DESC surface_desc; + BOOL skip_ati2n_once = FALSE; IDirect3DDevice9 *device; unsigned int i, j; IDirect3D9 *d3d; @@ -13735,7 +13736,11 @@ static void test_resource_access(void) if (tests[j].format == FORMAT_ATI2 && FAILED(IDirect3D9_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; }
@@ -13893,6 +13898,17 @@ static void test_resource_access(void) else format = colour_format;
+ if (tests[i].format == FORMAT_ATI2 && FAILED(IDirect3D9_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 = IDirect3DDevice9_CreateVolumeTexture(device, 16, 16, 1, 1, tests[i].usage, format, tests[i].pool, &texture, NULL); ok((hr == (!(tests[i].usage & ~D3DUSAGE_DYNAMIC)
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=137202
Your paranoid android.
=== w10pro64 (32 bit report) ===
d3d9: device.c:4167: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0. device.c:4211: Test failed: Expected message 0x7e for window 0, but didn't receive it, i=0. device.c:4215: Test failed: The device window is active, i=0. device.c:4220: Test failed: Got unexpected hr 0x88760869. device.c:4224: Test failed: Got unexpected screen size 800x600. device.c:4256: Test failed: Expected message 0x46 for window 0, but didn't receive it, i=0. device.c:4265: Test failed: Got unexpected screen size 800x600. device.c:4282: Test failed: Expected message 0x7e for window 0, but didn't receive it, i=0. device.c:4290: Test failed: Got unexpected width 640. device.c:4291: Test failed: Got unexpected height 480. device.c:4372: Test failed: Expected message 0x7e for window 0x1, but didn't receive it, i=0. device.c:4379: Test failed: Expected IsIconic 1, got 0, i=0. device.c:4383: Test failed: Got unexpected hr 0. device.c:4391: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0. device.c:4429: Test failed: Expected message 0x1c for window 0x1, but didn't receive it, i=0. device.c:4439: Test failed: Got unexpected hr 0. device.c:4497: Test failed: Expected message 0x18 for window 0, but didn't receive it, i=0. device.c:4503: Test failed: Got unexpected WINDOWPOS hwnd=00000000, insertAfter=00000000, x=0, y=0, cx=0, cy=0, flags=0 device.c:4520: Test failed: Expected the device window to be visible, i=0.
This merge request was approved by Zebediah Figura.
This merge request was approved by Jan Sikorski.