Module: wine Branch: master Commit: a0428db825a66a4d2e5e49a141cd54e406085ad3 URL: https://source.winehq.org/git/wine.git/?a=commit;h=a0428db825a66a4d2e5e49a14...
Author: Jacek Caban jacek@codeweavers.com Date: Wed May 19 20:19:22 2021 +0200
vulkan-1/tests: Don't destroy device if it wasn't created.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/vulkan-1/tests/vulkan.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/vulkan-1/tests/vulkan.c b/dlls/vulkan-1/tests/vulkan.c index 1d23c4112cf..f222c631232 100644 --- a/dlls/vulkan-1/tests/vulkan.c +++ b/dlls/vulkan-1/tests/vulkan.c @@ -455,7 +455,6 @@ static void test_null_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_physical_ uint32_t queue_family_index; VkPresentModeKHR *modes; VkSurfaceKHR surface; - VkDevice vk_device; uint32_t count; VkRect2D rect; VkBool32 bval; @@ -506,6 +505,8 @@ static void test_null_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_physical_
if (pvkGetPhysicalDevicePresentRectanglesKHR) { + VkDevice vk_device; + count = 0; vr = pvkGetPhysicalDevicePresentRectanglesKHR(vk_physical_device, surface, &count, NULL); ok(vr == VK_SUCCESS, "Got unexpected vr %d.\n", vr); @@ -526,6 +527,15 @@ static void test_null_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_physical_ vkDestroySurfaceKHR(vk_instance, surface, NULL); return; } + + if (0) + { + /* Causes access violation on Windows. */ + vr = vkGetDeviceGroupSurfacePresentModesKHR(vk_device, surface, &present_mode_flags); + ok(vr == VK_SUCCESS, "Got unexpected vr %d.\n", vr); + } + + vkDestroyDevice(vk_device, NULL); } else { @@ -535,14 +545,6 @@ static void test_null_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_physical_ win_skip("pvkGetPhysicalDevicePresentRectanglesKHR is no available.\n"); }
- if (0) - { - /* Causes access violation on Windows. */ - vr = vkGetDeviceGroupSurfacePresentModesKHR(vk_device, surface, &present_mode_flags); - ok(vr == VK_SUCCESS, "Got unexpected vr %d.\n", vr); - } - - vkDestroyDevice(vk_device, NULL); vkDestroySurfaceKHR(vk_instance, surface, NULL); }