Module: vkd3d Branch: master Commit: a6e482aa88f91658f13f2745dd242487db124aec URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=a6e482aa88f91658f13f2745...
Author: Józef Kucia jkucia@codeweavers.com Date: Mon Apr 1 11:19:47 2019 +0200
tests: Skip some tests when VKD3D_VULKAN_DEVICE is set.
Allows running tests with VKD3D_VULKAN_DEVICE.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
tests/vkd3d_api.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/tests/vkd3d_api.c b/tests/vkd3d_api.c index 89b388f..0bc4817 100644 --- a/tests/vkd3d_api.c +++ b/tests/vkd3d_api.c @@ -559,18 +559,25 @@ static void test_physical_device(void) vr = vkEnumeratePhysicalDevices(vk_instance, &count, vk_physical_devices); ok(vr == VK_SUCCESS, "Got unexpected VkResult %d.\n", vr);
- for (i = 0; i < count; ++i) + if (!getenv("VKD3D_VULKAN_DEVICE")) + { + for (i = 0; i < count; ++i) + { + trace("Creating device for Vulkan physical device %p.\n", vk_physical_devices[i]); + + create_info.vk_physical_device = vk_physical_devices[i]; + hr = vkd3d_create_device(&create_info, &IID_ID3D12Device, (void **)&device); + ok(hr == S_OK, "Failed to create device, hr %#x.\n", hr); + vk_physical_device = vkd3d_get_vk_physical_device(device); + ok(vk_physical_device == vk_physical_devices[i], + "Got unexpected Vulkan physical device %p.\n", vk_physical_device); + refcount = ID3D12Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + } + } + else { - trace("Creating device for Vulkan physical device %p.\n", vk_physical_devices[i]); - - create_info.vk_physical_device = vk_physical_devices[i]; - hr = vkd3d_create_device(&create_info, &IID_ID3D12Device, (void **)&device); - ok(hr == S_OK, "Failed to create device, hr %#x.\n", hr); - vk_physical_device = vkd3d_get_vk_physical_device(device); - ok(vk_physical_device == vk_physical_devices[i], - "Got unexpected Vulkan physical device %p.\n", vk_physical_device); - refcount = ID3D12Device_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); + skip("VKD3D_VULKAN_DEVICE is set.\n"); }
free(vk_physical_devices);