Commit 2dc3d245 authored by Andrew Wesie's avatar Andrew Wesie Committed by Alexandre Julliard

d3d9/tests: Regression test for query objects.

Minimal test case for the GPU hang in bug 45932. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45932Signed-off-by: 's avatarAndrew Wesie <awesie@gmail.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 6f5b8265
...@@ -5967,6 +5967,32 @@ static void test_occlusion_query(void) ...@@ -5967,6 +5967,32 @@ static void test_occlusion_query(void)
|| broken(data.dword[0] < 0xffffffff && !data.dword[1]), || broken(data.dword[0] < 0xffffffff && !data.dword[1]),
"Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]); "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]);
hr = IDirect3DDevice9_BeginScene(device);
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
for (i = 0; i < 50000; ++i)
{
hr = IDirect3DQuery9_Issue(query, D3DISSUE_BEGIN);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DQuery9_Issue(query, D3DISSUE_END);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
}
hr = IDirect3DDevice9_EndScene(device);
ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
for (i = 0; i < 500; ++i)
{
if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) == S_OK)
break;
Sleep(10);
}
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
memset(&data, 0xff, sizeof(data));
hr = IDirect3DQuery9_GetData(query, &data, sizeof(data), D3DGETDATA_FLUSH);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(data.dword[0] == 0 && data.dword[1] == 0,
"Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]);
IDirect3DSurface9_Release(rt); IDirect3DSurface9_Release(rt);
done: done:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment