From 935c03e37aff3b69420d3c5d9b4179e864bd1b47 Mon Sep 17 00:00:00 2001 From: Graeme Leese Date: Thu, 3 Mar 2022 17:55:48 +0000 Subject: [PATCH] Simplify isDeviceFunctionalitySupported Add comments explaining the two parts of the check and simplify the checking of extensions that the device reports are supported -- the feature bits are compulsory when the extension is supported. Components: Vulkan VK-GL-CTS issue: 3149 Affects: dEQP-VK.* Change-Id: Iec81cdf588146d2adb07871b5950024d3cdcf189 --- external/vulkancts/modules/vulkan/vktTestCase.cpp | 25 ++++++----------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/external/vulkancts/modules/vulkan/vktTestCase.cpp b/external/vulkancts/modules/vulkan/vktTestCase.cpp index cbfb022..7960d56 100644 --- a/external/vulkancts/modules/vulkan/vktTestCase.cpp +++ b/external/vulkancts/modules/vulkan/vktTestCase.cpp @@ -487,7 +487,10 @@ const vk::VkPhysicalDeviceVulkan13Features& Context::getDeviceVulkan13Features bool Context::isDeviceFunctionalitySupported (const std::string& extension) const { - // check if extension was promoted to core + // If extension was promoted to core then check using the core mechanism. This is required so that + // all core implementations have the functionality tested, even if they don't support the extension. + // (It also means that core-optional extensions will not be reported as supported unless the + // features are really supported if the CTS code adds all core extensions to the extension list). deUint32 apiVersion = getUsedApiVersion(); if (isCoreDeviceExtension(apiVersion, extension)) { @@ -565,25 +568,9 @@ bool Context::isDeviceFunctionalitySupported (const std::string& extension) cons return true; } - // check if extension is on the list of extensions for current device + // If this is not a core extension then just return whether the implementation says it's supported. const auto& extensions = getDeviceExtensions(); - if (de::contains(extensions.begin(), extensions.end(), extension)) - { - if (extension == "VK_KHR_timeline_semaphore") - return !!getTimelineSemaphoreFeatures().timelineSemaphore; - if (extension == "VK_KHR_synchronization2") - return !!getSynchronization2Features().synchronization2; - if (extension == "VK_EXT_extended_dynamic_state") - return !!getExtendedDynamicStateFeaturesEXT().extendedDynamicState; - if (extension == "VK_EXT_shader_demote_to_helper_invocation") - return !!getShaderDemoteToHelperInvocationFeatures().shaderDemoteToHelperInvocation; - if (extension == "VK_KHR_workgroup_memory_explicit_layout") - return !!getWorkgroupMemoryExplicitLayoutFeatures().workgroupMemoryExplicitLayout; - - return true; - } - - return false; + return de::contains(extensions.begin(), extensions.end(), extension); } bool Context::isInstanceFunctionalitySupported(const std::string& extension) const -- 2.7.4