Matteo Bruni : d3d8/tests: Port test_checkdevicemultisampletype() from d3d9.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Jan 28 10:06:46 CST 2016
Module: wine
Branch: master
Commit: 5baa8f0d18990e8626a068905f7c8e01c0f119e5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5baa8f0d18990e8626a068905f7c8e01c0f119e5
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Thu Jan 28 00:15:47 2016 +0100
d3d8/tests: Port test_checkdevicemultisampletype() from d3d9.
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 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index c1dc886..5b72b43 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -790,6 +790,61 @@ cleanup:
DestroyWindow(window);
}
+static void test_checkdevicemultisampletype(void)
+{
+ IDirect3D8 *d3d;
+ HWND window;
+ HRESULT hr;
+
+ window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
+ 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ ok(!!window, "Failed to create a window.\n");
+ d3d = Direct3DCreate8(D3D_SDK_VERSION);
+ ok(!!d3d, "Failed to create a D3D object.\n");
+
+ if (IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
+ D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES) == D3DERR_NOTAVAILABLE)
+ {
+ skip("Multisampling not supported for D3DFMT_X8R8G8B8, skipping test.\n");
+ goto cleanup;
+ }
+
+ hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
+ D3DFMT_UNKNOWN, TRUE, D3DMULTISAMPLE_NONE);
+ ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
+ 65536, TRUE, D3DMULTISAMPLE_NONE);
+ todo_wine ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
+ D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_NONE);
+ ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
+ D3DFMT_X8R8G8B8, FALSE, D3DMULTISAMPLE_NONE);
+ ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
+ D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES);
+ ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
+
+ /* We assume D3DMULTISAMPLE_15_SAMPLES is never supported in practice. */
+ hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
+ D3DFMT_X8R8G8B8, TRUE, D3DMULTISAMPLE_15_SAMPLES);
+ ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
+ D3DFMT_X8R8G8B8, TRUE, 65536);
+ ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+
+ hr = IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
+ D3DFMT_DXT5, TRUE, D3DMULTISAMPLE_2_SAMPLES);
+ ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr);
+
+cleanup:
+ IDirect3D8_Release(d3d);
+ DestroyWindow(window);
+}
+
static void test_cursor(void)
{
HMODULE user32_handle = GetModuleHandleA("user32.dll");
@@ -7786,6 +7841,7 @@ START_TEST(device)
test_swapchain();
test_refcount();
test_mipmap_levels();
+ test_checkdevicemultisampletype();
test_cursor();
test_cursor_pos();
test_states();
More information about the wine-cvs
mailing list