Enable used features in present_id_wait tests
authorziga-lunarg <ziga@lunarg.com>
Sat, 17 Sep 2022 15:31:33 +0000 (17:31 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 6 Oct 2022 21:07:13 +0000 (21:07 +0000)
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

external/vulkancts/modules/vulkan/wsi/vktWsiPresentIdWaitTests.cpp

index f32d7ee..af409cf 100644 (file)
@@ -189,10 +189,31 @@ vk::Move<vk::VkDevice> 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<vk::VkDevice> createDeviceWithWsi (const vk::PlatformInterface&                            vkp,
                nullptr,                                                                        // ppEnabledLayerNames
                static_cast<deUint32>(extensions.size()),       // enabledExtensionCount
                extensions.data(),                                                      // ppEnabledExtensionNames
-               &features
+               pNext ? DE_NULL : &features
        };
 
        return createCustomDevice(validationEnabled, vkp, instance, vki, physicalDevice, &deviceParams, pAllocator);