Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/vulkan-1/tests/vulkan.c | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+)
diff --git a/dlls/vulkan-1/tests/vulkan.c b/dlls/vulkan-1/tests/vulkan.c index 4143af752c..cb4d2e9e53 100644 --- a/dlls/vulkan-1/tests/vulkan.c +++ b/dlls/vulkan-1/tests/vulkan.c @@ -158,6 +158,69 @@ static void enumerate_physical_device(VkPhysicalDevice vk_physical_device) VK_VERSION_PATCH(properties.apiVersion)); }
+static void test_enumerate_physical_device2(void) +{ + static const char *extensions[] = {VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME}; + static const char *procs[] = {"vkGetPhysicalDeviceProperties2", "vkGetPhysicalDeviceProperties2KHR"}; + PFN_vkGetPhysicalDeviceProperties2 pfn_vkGetPhysicalDeviceProperties2; + VkPhysicalDeviceProperties2 properties2; + VkPhysicalDeviceIDProperties id; + VkPhysicalDevice *vk_physical_devices; + VkInstance vk_instance; + VkResult vr; + const LUID *luid; + uint32_t count; + unsigned int i, j; + + if ((vr = create_instance_skip(ARRAY_SIZE(extensions), extensions, &vk_instance)) < 0) return; + ok(vr == VK_SUCCESS, "Got unexpected VkResult %d.\n", vr); + + vr = vkEnumeratePhysicalDevices(vk_instance, &count, NULL); + ok(vr == VK_SUCCESS, "Got unexpected VkResult %d.\n", vr); + if (!count) + { + skip("No physical devices.\n"); + vkDestroyInstance(vk_instance, NULL); + return; + } + + vk_physical_devices = heap_calloc(count, sizeof(*vk_physical_devices)); + ok(!!vk_physical_devices, "Failed to allocate memory.\n"); + vr = vkEnumeratePhysicalDevices(vk_instance, &count, vk_physical_devices); + ok(vr == VK_SUCCESS, "Got unexpected VkResult %d.\n", vr); + + for (i = 0; i < ARRAY_SIZE(procs); ++i) + { + pfn_vkGetPhysicalDeviceProperties2 = + (PFN_vkGetPhysicalDeviceProperties2)vkGetInstanceProcAddr(vk_instance, procs[i]); + if (!pfn_vkGetPhysicalDeviceProperties2) + { + skip("%s is not available.\n", procs[i]); + return; + } + + for (j = 0; j < count; ++j) + { + properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; + properties2.pNext = &id; + + id.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; + id.pNext = NULL; + + pfn_vkGetPhysicalDeviceProperties2(vk_physical_devices[j], &properties2); + luid = (const LUID *)id.deviceLUID; + trace("Device '%s', device UUID:%s, driver UUID:%s, device LUID:%08x:%08x\n", + properties2.properties.deviceName, wine_dbgstr_guid((const GUID *)id.deviceUUID), + wine_dbgstr_guid((const GUID *)id.driverUUID), luid->HighPart, luid->LowPart); + todo_wine ok(id.deviceLUIDValid == VK_TRUE, "Expect valid device LUID \n"); + todo_wine ok(id.deviceNodeMask == 1, "Expect device node mask %08x, got %08x\n", 1, id.deviceNodeMask); + } + } + + heap_free(vk_physical_devices); + vkDestroyInstance(vk_instance, NULL); +} + static void enumerate_device_queues(VkPhysicalDevice vk_physical_device) { VkPhysicalDeviceProperties device_properties; @@ -359,6 +422,7 @@ START_TEST(vulkan) { test_instance_version(); for_each_device(enumerate_physical_device); + test_enumerate_physical_device2(); for_each_device(enumerate_device_queues); test_physical_device_groups(); for_each_device(test_destroy_command_pool);
Hi,
While running your changed tests on Windows, 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=45800
Your paranoid android.
=== debian9 (32 bit French report) ===
Report errors: : has no done line (or it is garbled)
=== debian9 (32 bit Japanese:Japan report) ===
Report errors: : has no done line (or it is garbled)