Matteo Bruni : d3d8/tests: Add a test for Reset() with bound DEFAULT resources.
Alexandre Julliard
julliard at winehq.org
Fri Feb 22 15:22:09 CST 2019
Module: wine
Branch: master
Commit: e2ffbf2e483889d4429bd2405c79875245a0a8b7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=e2ffbf2e483889d4429bd2405c79875245a0a8b7
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Wed Feb 20 18:41:10 2019 +0100
d3d8/tests: Add a test for Reset() with bound DEFAULT resources.
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d8/tests/device.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 39a2359..4dbe168 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -1327,6 +1327,7 @@ static void test_reset(void)
IDirect3D8 *d3d8;
RECT winrect, client_rect;
D3DVIEWPORT8 vp;
+ ULONG refcount;
D3DCAPS8 caps;
DWORD shader;
DWORD value;
@@ -1695,6 +1696,46 @@ static void test_reset(void)
skip("Volume textures not supported.\n");
}
+ /* Test with DEFAULT pool resources bound but otherwise not referenced. */
+ hr = IDirect3DDevice8_CreateVertexBuffer(device1, 16, 0,
+ D3DFVF_XYZ, D3DPOOL_DEFAULT, &vb);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice8_SetStreamSource(device1, 0, vb, 16);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ refcount = IDirect3DVertexBuffer8_Release(vb);
+ ok(!refcount, "Unexpected refcount %u.\n", refcount);
+ hr = IDirect3DDevice8_CreateIndexBuffer(device1, 16, 0,
+ D3DFMT_INDEX16, D3DPOOL_DEFAULT, &ib);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice8_SetIndices(device1, ib, 0);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ refcount = IDirect3DIndexBuffer8_Release(ib);
+ ok(!refcount, "Unexpected refcount %u.\n", refcount);
+ hr = IDirect3DDevice8_CreateTexture(device1, 16, 16, 0, 0,
+ D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &texture);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice8_SetTexture(device1, i, (IDirect3DBaseTexture8 *)texture);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3DDevice8_Reset(device1, &d3dpp);
+ ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice8_TestCooperativeLevel(device1);
+ ok(hr == D3DERR_DEVICENOTRESET, "Got unexpected hr %#x.\n", hr);
+
+ /* Crashes on Windows. */
+ if (0)
+ {
+ hr = IDirect3DDevice8_GetIndices(device1, &ib, &i);
+ todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+ }
+ refcount = IDirect3DTexture8_Release(texture);
+ ok(!refcount, "Unexpected refcount %u.\n", refcount);
+
+ hr = IDirect3DDevice8_Reset(device1, &d3dpp);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice8_TestCooperativeLevel(device1);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
/* Scratch, sysmem and managed pool resources are fine. */
hr = IDirect3DDevice8_CreateTexture(device1, 16, 16, 1, 0, D3DFMT_R5G6B5, D3DPOOL_SCRATCH, &texture);
ok(SUCCEEDED(hr), "CreateTexture failed, hr %#x.\n", hr);
More information about the wine-cvs
mailing list