vulkan-1/tests: Consider vkGetPhysicalDevicePresentRectanglesKHR absence in test_null_hwnd().

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2021-05-07 14:31:01 +03:00 committed by Alexandre Julliard
parent b44fb883b0
commit 4ac1c48e9d
1 changed files with 30 additions and 15 deletions

View File

@ -441,11 +441,13 @@ static const char *test_null_hwnd_extensions[] =
{ {
"VK_KHR_surface", "VK_KHR_surface",
"VK_KHR_win32_surface", "VK_KHR_win32_surface",
"VK_KHR_device_group_creation",
}; };
static void test_null_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_physical_device) static void test_null_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_physical_device)
{ {
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR pvkGetPhysicalDeviceSurfacePresentModesKHR; PFN_vkGetPhysicalDeviceSurfacePresentModesKHR pvkGetPhysicalDeviceSurfacePresentModesKHR;
PFN_vkGetPhysicalDevicePresentRectanglesKHR pvkGetPhysicalDevicePresentRectanglesKHR;
VkDeviceGroupPresentModeFlagsKHR present_mode_flags; VkDeviceGroupPresentModeFlagsKHR present_mode_flags;
VkWin32SurfaceCreateInfoKHR surface_create_info; VkWin32SurfaceCreateInfoKHR surface_create_info;
VkSurfaceCapabilitiesKHR surf_caps; VkSurfaceCapabilitiesKHR surf_caps;
@ -461,6 +463,9 @@ static void test_null_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_physical_
pvkGetPhysicalDeviceSurfacePresentModesKHR = (void *)vkGetInstanceProcAddr(vk_instance, pvkGetPhysicalDeviceSurfacePresentModesKHR = (void *)vkGetInstanceProcAddr(vk_instance,
"vkGetPhysicalDeviceSurfacePresentModesKHR"); "vkGetPhysicalDeviceSurfacePresentModesKHR");
pvkGetPhysicalDevicePresentRectanglesKHR = (void *)vkGetInstanceProcAddr(vk_instance,
"vkGetPhysicalDevicePresentRectanglesKHR");
surface_create_info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; surface_create_info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
surface_create_info.pNext = NULL; surface_create_info.pNext = NULL;
surface_create_info.flags = 0; surface_create_info.flags = 0;
@ -499,12 +504,14 @@ static void test_null_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_physical_
ok(vr == VK_SUCCESS, "Got unexpected vr %d.\n", vr); ok(vr == VK_SUCCESS, "Got unexpected vr %d.\n", vr);
heap_free(modes); heap_free(modes);
if (pvkGetPhysicalDevicePresentRectanglesKHR)
{
count = 0; count = 0;
vr = vkGetPhysicalDevicePresentRectanglesKHR(vk_physical_device, surface, &count, NULL); vr = pvkGetPhysicalDevicePresentRectanglesKHR(vk_physical_device, surface, &count, NULL);
ok(vr == VK_SUCCESS, "Got unexpected vr %d.\n", vr); ok(vr == VK_SUCCESS, "Got unexpected vr %d.\n", vr);
ok(count == 1, "Got unexpected count %u.\n", count); ok(count == 1, "Got unexpected count %u.\n", count);
memset(&rect, 0xcc, sizeof(rect)); memset(&rect, 0xcc, sizeof(rect));
vr = vkGetPhysicalDevicePresentRectanglesKHR(vk_physical_device, surface, &count, &rect); vr = pvkGetPhysicalDevicePresentRectanglesKHR(vk_physical_device, surface, &count, &rect);
if (vr == VK_SUCCESS) /* Fails on AMD, succeeds on Nvidia. */ if (vr == VK_SUCCESS) /* Fails on AMD, succeeds on Nvidia. */
{ {
ok(count == 1, "Got unexpected count %u.\n", count); ok(count == 1, "Got unexpected count %u.\n", count);
@ -519,6 +526,14 @@ static void test_null_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_physical_
vkDestroySurfaceKHR(vk_instance, surface, NULL); vkDestroySurfaceKHR(vk_instance, surface, NULL);
return; return;
} }
}
else
{
/* The function should be available in practice with VK_KHR_device_group_creation, but spec lists
* it as a part of VK_KHR_device_group device extension which we don't check, so consider the
* absence of the function. */
win_skip("pvkGetPhysicalDevicePresentRectanglesKHR is no available.\n");
}
if (0) if (0)
{ {