Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/d3d8/device.c | 1 + dlls/d3d8/tests/device.c | 51 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 400e1e292a..23e93df061 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -730,6 +730,7 @@ static HRESULT WINAPI d3d8_device_GetCreationParameters(IDirect3DDevice8 *iface, (struct wined3d_device_creation_parameters *)parameters); wined3d_mutex_unlock();
+ parameters->AdapterOrdinal = device->adapter_ordinal; return D3D_OK; }
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 42eee28217..27ece75bc3 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -9870,6 +9870,56 @@ static void test_multi_adapter(void) IDirect3D8_Release(d3d); }
+static void test_creation_parameters(void) +{ + unsigned int adapter_idx, adapter_count; + D3DDEVICE_CREATION_PARAMETERS params; + struct device_desc device_desc; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + HWND window; + HRESULT hr; + + window = create_window(); + ok(!!window, "Failed to create a window.\n"); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + device_desc.device_window = window; + device_desc.width = 640; + device_desc.height = 480; + device_desc.flags = 0; + + adapter_count = IDirect3D8_GetAdapterCount(d3d); + for (adapter_idx = 0; adapter_idx < adapter_count; ++adapter_idx) + { + device_desc.adapter_ordinal = adapter_idx; + if (!(device = create_device(d3d, window, &device_desc))) + { + skip("Adapter %u: Failed to create a D3D device.\n", adapter_idx); + break; + } + + memset(¶ms, 0, sizeof(params)); + hr = IDirect3DDevice8_GetCreationParameters(device, ¶ms); + ok(hr == D3D_OK, "Adapter %u: GetCreationParameters failed, hr %#x.\n", adapter_idx, hr); + ok(params.AdapterOrdinal == adapter_idx, "Adapter %u: Got unexpected adapter ordinal %u.\n", + adapter_idx, params.AdapterOrdinal); + ok(params.DeviceType == D3DDEVTYPE_HAL, "Adapter %u: Expect device type %#x, got %#x.\n", + adapter_idx, D3DDEVTYPE_HAL, params.DeviceType); + ok(params.hFocusWindow == window, "Adapter %u: Expect focus window %p, got %p.\n", + adapter_idx, window, params.hFocusWindow); + ok(params.BehaviorFlags == D3DCREATE_HARDWARE_VERTEXPROCESSING, + "Adapter %u: Expect behavior flags %#lx, got %#x.\n", adapter_idx, + D3DCREATE_HARDWARE_VERTEXPROCESSING, params.BehaviorFlags); + + IDirect3DDevice8_Release(device); + } + + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { HMODULE d3d8_handle = GetModuleHandleA("d3d8.dll"); @@ -9987,6 +10037,7 @@ START_TEST(device) test_draw_primitive(); test_get_display_mode(); test_multi_adapter(); + test_creation_parameters();
UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL)); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=67524
Your paranoid android.
=== w1064v1809_ja (32 bit report) ===
d3d8: device.c:989: Test failed: The cursor handle is 00010003
On Thu, 19 Mar 2020 at 12:39, Zhiyi Zhang zzhang@codeweavers.com wrote:
ok(params.BehaviorFlags == D3DCREATE_HARDWARE_VERTEXPROCESSING,
"Adapter %u: Expect behavior flags %#lx, got %#x.\n", adapter_idx,
D3DCREATE_HARDWARE_VERTEXPROCESSING, params.BehaviorFlags);
Although unlikely on current hardware, note that create_device() will try to create a device with D3DCREATE_SOFTWARE_VERTEXPROCESSING if creating one with D3DCREATE_HARDWARE_VERTEXPROCESSING failed.