[PATCH 4/5] d3d8/tests: Allow the creation of SWVP devices
Stefan Dösinger
stefan at codeweavers.com
Mon Jan 14 17:13:06 CST 2013
---
dlls/d3d8/tests/device.c | 59 ++++++++++++++++++++++++------------------------
1 file changed, 30 insertions(+), 29 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 17c3443..dff0d73 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -72,7 +72,8 @@ static void flush_events(void)
}
}
-static IDirect3DDevice8 *create_device(IDirect3D8 *d3d8, HWND device_window, HWND focus_window, BOOL windowed)
+static IDirect3DDevice8 *create_device(IDirect3D8 *d3d8, HWND device_window, HWND focus_window, BOOL windowed,
+ DWORD flags)
{
D3DPRESENT_PARAMETERS present_parameters = {0};
IDirect3DDevice8 *device;
@@ -87,7 +88,7 @@ static IDirect3DDevice8 *create_device(IDirect3D8 *d3d8, HWND device_window, HWN
present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8;
if (SUCCEEDED(IDirect3D8_CreateDevice(d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window,
- D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device))) return device;
+ flags, &present_parameters, &device))) return device;
present_parameters.AutoDepthStencilFormat = D3DFMT_D16;
if (SUCCEEDED(IDirect3D8_CreateDevice(d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window,
@@ -848,7 +849,7 @@ static void test_cursor_pos(void)
0, 0, 320, 240, NULL, NULL, NULL, NULL);
ShowWindow(window, SW_SHOW);
- device = create_device(d3d8, window, window, TRUE);
+ device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -2317,7 +2318,7 @@ static void test_wndproc(void)
expect_messages = messages;
- device = create_device(d3d8, device_window, focus_window, FALSE);
+ device = create_device(d3d8, device_window, focus_window, FALSE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -2355,7 +2356,7 @@ static void test_wndproc(void)
ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n",
(LONG_PTR)test_proc, proc);
- device = create_device(d3d8, focus_window, focus_window, FALSE);
+ device = create_device(d3d8, focus_window, focus_window, FALSE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -2365,7 +2366,7 @@ static void test_wndproc(void)
ref = IDirect3DDevice8_Release(device);
ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref);
- device = create_device(d3d8, device_window, focus_window, FALSE);
+ device = create_device(d3d8, device_window, focus_window, FALSE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -2459,7 +2460,7 @@ static void test_wndproc_windowed(void)
filter_messages = focus_window;
- device = create_device(d3d8, device_window, focus_window, TRUE);
+ device = create_device(d3d8, device_window, focus_window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -2511,7 +2512,7 @@ static void test_wndproc_windowed(void)
filter_messages = device_window;
- device = create_device(d3d8, focus_window, focus_window, TRUE);
+ device = create_device(d3d8, focus_window, focus_window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -2547,7 +2548,7 @@ static void test_wndproc_windowed(void)
ref = IDirect3DDevice8_Release(device);
ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref);
- device = create_device(d3d8, device_window, focus_window, TRUE);
+ device = create_device(d3d8, device_window, focus_window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -2772,7 +2773,7 @@ static void test_depth_stencil_size(void)
ok(hwnd != NULL, "Failed to create window\n");
if (!d3d8 || !hwnd) goto cleanup;
- device = create_device(d3d8, hwnd, hwnd, TRUE);
+ device = create_device(d3d8, hwnd, hwnd, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device) goto cleanup;
hr = IDirect3DDevice8_CreateRenderTarget(device, 64, 64, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, FALSE, &rt);
@@ -2851,7 +2852,7 @@ static void test_window_style(void)
SetRect(&fullscreen_rect, 0, 0, screen_width, screen_height);
GetWindowRect(focus_window, &focus_rect);
- device = create_device(d3d8, device_window, focus_window, FALSE);
+ device = create_device(d3d8, device_window, focus_window, FALSE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -3003,7 +3004,7 @@ static void test_mode_change(void)
SetRect(&fullscreen_rect, 0, 0, screen_width, screen_height);
GetWindowRect(focus_window, &focus_rect);
- device = create_device(d3d8, device_window, focus_window, FALSE);
+ device = create_device(d3d8, device_window, focus_window, FALSE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -3102,7 +3103,7 @@ static void test_device_window_reset(void)
ok(proc == (LONG_PTR)test_proc, "Expected wndproc %#lx, got %#lx.\n",
(LONG_PTR)test_proc, proc);
- device = create_device(d3d8, NULL, focus_window, FALSE);
+ device = create_device(d3d8, NULL, focus_window, FALSE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -3171,7 +3172,7 @@ static void depth_blit_test(void)
if (!d3d8 || !hwnd)
goto done;
- device = create_device(d3d8, hwnd, hwnd, TRUE);
+ device = create_device(d3d8, hwnd, hwnd, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING);
if (!device)
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -3246,7 +3247,7 @@ static void test_reset_resources(void)
return;
}
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
goto done;
@@ -3309,7 +3310,7 @@ static void test_set_rt_vp_scissor(void)
window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
DestroyWindow(window);
@@ -3488,7 +3489,7 @@ static void test_volume_get_container(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d8);
@@ -3590,7 +3591,7 @@ static void test_vb_lock_flags(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d8);
@@ -3641,7 +3642,7 @@ static void test_texture_stage_states(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d8);
@@ -3734,7 +3735,7 @@ static void test_cube_textures(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d8);
@@ -3810,7 +3811,7 @@ static void test_image_surface_pool(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d8);
@@ -3850,7 +3851,7 @@ static void test_surface_get_container(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d8);
@@ -3946,7 +3947,7 @@ static void test_lockrect_invalid(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d8);
@@ -4038,7 +4039,7 @@ static void test_private_data(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d8);
@@ -4122,7 +4123,7 @@ static void test_surface_dimensions(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d8);
@@ -4172,7 +4173,7 @@ static void test_surface_format_null(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d, window, window, TRUE)))
+ if (!(device = create_device(d3d, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d);
@@ -4260,7 +4261,7 @@ static void test_surface_double_unlock(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d, window, window, TRUE)))
+ if (!(device = create_device(d3d, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d);
@@ -4371,7 +4372,7 @@ static void test_surface_lockrect_blocks(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d, window, window, TRUE)))
+ if (!(device = create_device(d3d, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d);
@@ -4488,7 +4489,7 @@ static void test_set_palette(void)
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
- if (!(device = create_device(d3d8, window, window, TRUE)))
+ if (!(device = create_device(d3d8, window, window, TRUE, D3DCREATE_HARDWARE_VERTEXPROCESSING)))
{
skip("Failed to create a D3D device, skipping tests.\n");
IDirect3D8_Release(d3d8);
--
1.7.12.4
More information about the wine-patches
mailing list