From 578c849b7831ace89990033b0a2ca89ac4affe16 Mon Sep 17 00:00:00 2001 From: ziga-lunarg Date: Sat, 17 Sep 2022 17:31:33 +0200 Subject: [PATCH] Enable used features in present_id_wait tests Featuers presentId and presentWait are used, but not enabled Components: Vulkan VK-GL-CTS issue: 3957 Affected tests: dEQP-VK.wsi.win32.present_id_wait.* Change-Id: Ia6e899d65c05a81876c5d46b8426425c10b657f1 --- .../vulkan/wsi/vktWsiPresentIdWaitTests.cpp | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiPresentIdWaitTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiPresentIdWaitTests.cpp index f32d7ee7a..af409cf20 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiPresentIdWaitTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiPresentIdWaitTests.cpp @@ -189,10 +189,31 @@ vk::Move createDeviceWithWsi (const vk::PlatformInterface& vkp, extensions.push_back(ext); deMemset(&features, 0, sizeof(features)); + + vk::VkPhysicalDeviceFeatures2 physicalDeviceFeatures2 { vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, DE_NULL, features }; + + vk::VkPhysicalDevicePresentIdFeaturesKHR presentIdFeatures = { vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR, DE_NULL, DE_TRUE }; + vk::VkPhysicalDevicePresentWaitFeaturesKHR presentWaitFeatures = { vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR, DE_NULL, DE_TRUE }; + + void* pNext = DE_NULL; + for (size_t i = 0; i < extraExtensions.size(); ++i) { + if (strcmp(extraExtensions[i], "VK_KHR_present_id") == 0) + { + presentIdFeatures.pNext = pNext; + pNext = &presentIdFeatures; + } + else if (strcmp(extraExtensions[i], "VK_KHR_present_wait") == 0) + { + presentWaitFeatures.pNext = pNext; + pNext = &presentWaitFeatures; + } + } + physicalDeviceFeatures2.pNext = pNext; + const vk::VkDeviceCreateInfo deviceParams = { vk::VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, - nullptr, + pNext ? &physicalDeviceFeatures2 : DE_NULL, (vk::VkDeviceCreateFlags)0, DE_LENGTH_OF_ARRAY(queueInfos), &queueInfos[0], @@ -200,7 +221,7 @@ vk::Move createDeviceWithWsi (const vk::PlatformInterface& vkp, nullptr, // ppEnabledLayerNames static_cast(extensions.size()), // enabledExtensionCount extensions.data(), // ppEnabledExtensionNames - &features + pNext ? DE_NULL : &features }; return createCustomDevice(validationEnabled, vkp, instance, vki, physicalDevice, &deviceParams, pAllocator); -- 2.34.1