Check available functionality with context method
authorPiotr Byszewski <piotr.byszewski@mobica.com>
Tue, 15 Oct 2019 09:06:51 +0000 (11:06 +0200)
committerPiotr Byszewski <piotr.byszewski@mobica.com>
Fri, 25 Oct 2019 10:10:41 +0000 (12:10 +0200)
This change adds Context::isDeviceFunctionalitySupported and
Context::isInstanceFunctionalitySupported methods that replace
isDeviceExtensionSupported/isInstanceExtensionSupported.

Components: Framework

VK-GL-CTS issue: 2005

Affects:
dEQP-VK.*

Change-Id: If796fc31fe6e769495cdf1ccefa4ae8192caf2b5

95 files changed:
external/vulkancts/framework/vulkan/vkDeviceFeatures.cpp
external/vulkancts/framework/vulkan/vkMandatoryFeatures.inl
external/vulkancts/framework/vulkan/vkQueryUtil.cpp
external/vulkancts/framework/vulkan/vkQueryUtil.hpp
external/vulkancts/modules/vulkan/api/vktApiBufferAndImageAllocationUtil.cpp
external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp
external/vulkancts/modules/vulkan/api/vktApiBufferViewCreateTests.cpp
external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp
external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp
external/vulkancts/modules/vulkan/api/vktApiDescriptorPoolTests.cpp
external/vulkancts/modules/vulkan/api/vktApiDescriptorSetTests.cpp
external/vulkancts/modules/vulkan/api/vktApiDriverPropertiesTests.cpp
external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp
external/vulkancts/modules/vulkan/api/vktApiImageClearingTests.cpp
external/vulkancts/modules/vulkan/api/vktApiMaintenance3Check.cpp
external/vulkancts/modules/vulkan/api/vktApiMemoryRequirementInvarianceTests.cpp
external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp
external/vulkancts/modules/vulkan/binding_model/vktBindingBufferDeviceAddressTests.cpp
external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorSetRandomTests.cpp
external/vulkancts/modules/vulkan/clipping/vktClippingTests.cpp
external/vulkancts/modules/vulkan/conditional_rendering/vktConditionalDrawAndClearTests.cpp
external/vulkancts/modules/vulkan/conditional_rendering/vktConditionalRenderingTestUtil.cpp
external/vulkancts/modules/vulkan/descriptor_indexing/vktDescriptorSetsIndexingTests.cpp
external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp
external/vulkancts/modules/vulkan/draw/vktDrawDiscardRectanglesTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp
external/vulkancts/modules/vulkan/draw/vktDrawInstancedTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawInvertedDepthRangesTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawNegativeViewportHeightTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawShaderDrawParametersTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawShaderLayerTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawShaderViewportIndexTests.cpp
external/vulkancts/modules/vulkan/fragment_shader_interlock/vktFragmentShaderInterlockBasic.cpp
external/vulkancts/modules/vulkan/geometry/vktGeometryLayeredRenderingTests.cpp
external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp
external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp
external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp
external/vulkancts/modules/vulkan/image/vktImageTranscodingSupportTests.cpp
external/vulkancts/modules/vulkan/imageless_framebuffer/vktImagelessFramebufferTests.cpp
external/vulkancts/modules/vulkan/memory/vktMemoryBindingTests.cpp
external/vulkancts/modules/vulkan/memory/vktMemoryExternalMemoryHostTests.cpp
external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp
external/vulkancts/modules/vulkan/memory/vktMemoryRequirementsTests.cpp
external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineCreationFeedbackTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineDepthRangeUnrestrictedTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineExecutablePropertiesTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineInputAssemblyTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleSampleLocationsExtTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineRenderToImageTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineStencilExportTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineTimestampTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.cpp
external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp
external/vulkancts/modules/vulkan/query_pool/vktQueryPoolStatisticsTests.cpp
external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp
external/vulkancts/modules/vulkan/renderpass/vktRenderPassDepthStencilResolveTests.cpp
external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleResolveTests.cpp
external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleTests.cpp
external/vulkancts/modules/vulkan/renderpass/vktRenderPassSampleReadTests.cpp
external/vulkancts/modules/vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp
external/vulkancts/modules/vulkan/renderpass/vktRenderPassSubpassDependencyTests.cpp
external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp
external/vulkancts/modules/vulkan/renderpass/vktRenderPassUnusedAttachmentTests.cpp
external/vulkancts/modules/vulkan/renderpass/vktRenderPassUnusedClearAttachmentTests.cpp
external/vulkancts/modules/vulkan/robustness/vktRobustBufferAccessWithVariablePointersTests.cpp
external/vulkancts/modules/vulkan/shaderexecutor/vktAtomicOperationTests.cpp
external/vulkancts/modules/vulkan/shaderexecutor/vktOpaqueTypeIndexingTests.cpp
external/vulkancts/modules/vulkan/shaderexecutor/vktShaderClockTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUtils.cpp
external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotMasksTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsVoteTests.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationCrossInstanceSharingTests.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.hpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationWin32KeyedMutexTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationWindingTests.cpp
external/vulkancts/modules/vulkan/transform_feedback/vktTransformFeedbackSimpleTests.cpp
external/vulkancts/modules/vulkan/vktCustomInstancesDevices.cpp
external/vulkancts/modules/vulkan/vktTestCase.cpp
external/vulkancts/modules/vulkan/vktTestCase.hpp
external/vulkancts/modules/vulkan/vktTestPackage.cpp
external/vulkancts/modules/vulkan/wsi/vktWsiSurfaceTests.cpp
external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp
external/vulkancts/modules/vulkan/ycbcr/vktYCbCrConversionTests.cpp
external/vulkancts/modules/vulkan/ycbcr/vktYCbCrFormatTests.cpp
external/vulkancts/modules/vulkan/ycbcr/vktYCbCrUtil.cpp
external/vulkancts/scripts/gen_framework.py

index b403cb6f46271a8276b8e1bb5472541e7f5b37aa..520423ee29b01ad9bd837607be3abc02c6cf11da 100644 (file)
 namespace vk
 {
 
-static bool isPhysicalDeviceFeatures2Supported (const deUint32 version, const std::vector<std::string>& instanceExtensions)
-{
-       return isInstanceExtensionSupported(version, instanceExtensions, "VK_KHR_get_physical_device_properties2");
-}
-
 DeviceFeatures::DeviceFeatures (const InstanceInterface&                       vki,
                                                                 const deUint32                                         apiVersion,
                                                                 const VkPhysicalDevice                         physicalDevice,
@@ -40,7 +35,7 @@ DeviceFeatures::DeviceFeatures        (const InstanceInterface&                       vki,
        deMemset(&m_coreFeatures2, 0, sizeof(m_coreFeatures2));
        m_coreFeatures2.sType   = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
 
-       if (isPhysicalDeviceFeatures2Supported(apiVersion, instanceExtensions))
+       if (isInstanceExtensionSupported(apiVersion, instanceExtensions, "VK_KHR_get_physical_device_properties2"))
        {
                const std::vector<VkExtensionProperties>        deviceExtensionProperties       = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
                void**                                                                          nextPtr                                         = &m_coreFeatures2.pNext;
index c782865cad97d1b4871ffb779a443dff487c8da7..5a0eb84bb7994f8eb36393be120894828ade0906 100644 (file)
@@ -3,7 +3,7 @@
  */
 bool checkMandatoryFeatures(const vkt::Context& context)
 {
-       if ( !vk::isInstanceExtensionSupported(context.getUsedApiVersion(), context.getInstanceExtensions(), "VK_KHR_get_physical_device_properties2") )
+       if ( !context.isInstanceFunctionalitySupported("VK_KHR_get_physical_device_properties2") )
                TCU_THROW(NotSupportedError, "Extension VK_KHR_get_physical_device_properties2 is not present");
 
        VkPhysicalDevice                                        physicalDevice          = context.getPhysicalDevice();
index 717d88982fe56a8ca24ad44b4e8376ad10c1a1b7..8f7be39c8cc265da8ba6841fa87bbc6ffad5e924 100644 (file)
@@ -403,38 +403,6 @@ bool isCompatible (const VkLayerProperties& layerProperties, const RequiredLayer
        return true;
 }
 
-bool isInstanceExtensionSupported (const deUint32 instanceVersion, const std::vector<std::string>& extensions, const std::string& required)
-{
-       if (isCoreInstanceExtension(instanceVersion, required))
-               return true;
-       else
-               return de::contains(extensions.begin(), extensions.end(), required);
-}
-
-bool isDeviceExtensionSupported (const deUint32 deviceVersion, const std::vector<std::string>& extensions, const std::string& required)
-{
-       if (isCoreDeviceExtension(deviceVersion, required))
-               return true;
-       else
-               return de::contains(extensions.begin(), extensions.end(), required);
-}
-
-bool isInstanceExtensionSupported (const deUint32 instanceVersion, const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required)
-{
-       if (isCoreInstanceExtension(instanceVersion, required.name))
-               return true;
-       else
-               return isExtensionSupported(extensions.begin(), extensions.end(), required);
-}
-
-bool isDeviceExtensionSupported (const deUint32 deviceVersion, const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required)
-{
-       if (isCoreDeviceExtension(deviceVersion, required.name))
-               return true;
-       else
-               return isExtensionSupported(extensions.begin(), extensions.end(), required);
-}
-
 bool isExtensionSupported (const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required)
 {
        return isExtensionSupported(extensions.begin(), extensions.end(), required);
@@ -445,6 +413,15 @@ bool isExtensionSupported (const vector<std::string>& extensionStrings, const st
        return de::contains(extensionStrings.begin(), extensionStrings.end(), extensionName);
 }
 
+bool isInstanceExtensionSupported(const deUint32 instanceVersion, const std::vector<std::string>& extensions, const std::string& required)
+{
+       // NOTE: this function is only needed in few cases during creation of context,
+       // dont use it, call Context::isInstanceFunctionalitySupported instead
+       if (isCoreInstanceExtension(instanceVersion, required))
+               return true;
+       return de::contains(extensions.begin(), extensions.end(), required);
+}
+
 bool isLayerSupported (const std::vector<VkLayerProperties>& layers, const RequiredLayer& required)
 {
        return isLayerSupported(layers.begin(), layers.end(), required);
index 933aca174338dcbbcbf7f6f9503bb01877aef41c..27a22d5eec284aec204d55c2309024b981e50541 100644 (file)
@@ -112,10 +112,8 @@ bool                                                                               isCompatible                                                    (const VkLayerProperties& layerProperties, cons
 template<typename ExtensionIterator>
 bool                                                                           isExtensionSupported                                    (ExtensionIterator begin, ExtensionIterator end, const RequiredExtension& required);
 bool                                                                           isExtensionSupported                                    (const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required);
-bool                                                                           isDeviceExtensionSupported                              (const deUint32 deviceVersion, const std::vector<std::string>& extensions, const std::string& required);
+
 bool                                                                           isInstanceExtensionSupported                    (const deUint32 instanceVersion, const std::vector<std::string>& extensions, const std::string& required);
-bool                                                                           isDeviceExtensionSupported                              (const deUint32 deviceVersion, const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required);
-bool                                                                           isInstanceExtensionSupported                    (const deUint32 instanceVersion, const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required);
 
 template<typename LayerIterator>
 bool                                                                           isLayerSupported                                                (LayerIterator begin, LayerIterator end, const RequiredLayer& required);
index 80ce33af9c6c2640a64a2855b413619d785a1381..f6ec0c7738f3113581ac70114c671a72e01ce18a 100644 (file)
@@ -75,12 +75,8 @@ void BufferDedicatedAllocation::createTestBuffer                                             (VkDeviceSize                           size,
                                                                                                                                                 de::MovePtr<Allocation>&       memory) const
 {
        DE_UNREF(allocator);
-       const std::vector<std::string>& extensions                                                      = context.getDeviceExtensions();
-       const deBool                                    isSupported                                                     = isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation");
-       if (!isSupported)
-       {
+       if (!context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
                TCU_THROW(NotSupportedError, "Not supported");
-       }
 
        const InstanceInterface&                        vkInstance                                              = context.getInstanceInterface();
        const VkDevice                                          vkDevice                                                = context.getDevice();
@@ -153,12 +149,8 @@ void ImageDedicatedAllocation::createTestImage                                                     (tcu::IVec2                                     size,
                                                                                                                                                 VkImageTiling                          tiling) const
 {
        DE_UNREF(allocator);
-       const std::vector<std::string>&         extensions                                              = context.getDeviceExtensions();
-       const deBool                                            isSupported                                             = isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation");
-       if (!isSupported)
-       {
+       if (!context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
                TCU_THROW(NotSupportedError, "Not supported");
-       }
 
        const InstanceInterface&                        vkInstance                                              = context.getInstanceInterface();
        const VkDevice                                          vkDevice                                                = context.getDevice();
index 38c13a74e5df92a04a56825b7d50da1a809cc05f..af1a4d6f3131032309a49a04b0c596386091fc12 100644 (file)
@@ -183,12 +183,8 @@ class DedicatedAllocationBuffersTestCase : public TestCase
 
        virtual void                                            checkSupport                                    (Context&                                       ctx) const
        {
-               const std::vector<std::string>& extensions              = ctx.getDeviceExtensions();
-               const deBool                                    isSupported             = isDeviceExtensionSupported(ctx.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation");
-               if (!isSupported)
-               {
+               if (!ctx.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
                        TCU_THROW(NotSupportedError, "Not supported");
-               }
        }
 private:
        BufferCaseParameters                            m_testCase;
index 490ee8f12686d19a88b1faf3abc70d7aca692a11..f25ca0d43d80e42a16a001a02561e000ff1e4cf4 100644 (file)
@@ -132,9 +132,7 @@ public:
                        TCU_THROW(NotSupportedError, "Format not supported");
                if (m_testCase.bufferAllocationKind == ALLOCATION_KIND_DEDICATED)
                {
-                       const std::vector<std::string>&         extensions = ctx.getDeviceExtensions();
-                       const deBool                                            isSupported = isDeviceExtensionSupported(ctx.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation");
-                       if (!isSupported)
+                       if (!ctx.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
                                TCU_THROW(NotSupportedError, "Dedicated allocation not supported");
                }
        }
index 3596e2a9e758383966f59dc6434606d4b2be0fea..602a21443cd3682d596e341b8488444ae9f75995 100644 (file)
@@ -962,7 +962,7 @@ bool executeSecondaryCmdBuffer (Context&                                            context,
 
 tcu::TestStatus trimCommandPoolTest (Context& context, const VkCommandBufferLevel cmdBufferLevel)
 {
-       if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1"))
+       if (!context.isDeviceFunctionalitySupported("VK_KHR_maintenance1"))
                TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance1 not supported");
 
        const VkDevice                                                  vkDevice                                = context.getDevice();
index 9668657b5a8a5c526452b10cd6e3ff15394d31b8..4a7addbe3cf606c3c9fb0f7d1f10ee44d6940408 100644 (file)
@@ -1162,14 +1162,14 @@ public:
        {
                if (m_params.allocationKind == ALLOCATION_KIND_DEDICATED)
                {
-                       if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation"))
+                       if (!context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
                                TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported");
                }
 
                if ((m_params.dst.image.imageType == VK_IMAGE_TYPE_3D && m_params.src.image.imageType == VK_IMAGE_TYPE_2D) ||
                        (m_params.dst.image.imageType == VK_IMAGE_TYPE_2D && m_params.src.image.imageType == VK_IMAGE_TYPE_3D))
                {
-                       if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1"))
+                       if (!context.isDeviceFunctionalitySupported("VK_KHR_maintenance1"))
                                TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance1 not supported");
                }
 
index 03d7c571297948fb9dbd0e05b78fdba7b001b8a5..96518dbde5e9ac0d7b10da9cc062dd5319b1a508 100644 (file)
@@ -162,7 +162,7 @@ tcu::TestStatus outOfPoolMemoryTest (Context& context)
 {
        const DeviceInterface&  vkd                                                     = context.getDeviceInterface();
        const VkDevice                  device                                          = context.getDevice();
-       const bool                              expectOutOfPoolMemoryError      = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1");
+       const bool                              expectOutOfPoolMemoryError      = context.isDeviceFunctionalitySupported("VK_KHR_maintenance1");
        deUint32                                numErrorsReturned                       = 0;
 
        const struct FailureCase
index 288fc01174e754abd063f6c41d5cb5cb75ee303e..5ce75294c53967b9e4c85945564531d1acd9798e 100644 (file)
@@ -225,7 +225,7 @@ tcu::TestStatus emptyDescriptorSetLayoutTest (Context& context, VkDescriptorSetL
        const VkDevice                                                  device                                                  = context.getDevice();
 
        if (descriptorSetLayoutCreateFlags == VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR)
-               if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_push_descriptor"))
+               if (!context.isDeviceFunctionalitySupported("VK_KHR_push_descriptor"))
                        TCU_THROW(NotSupportedError, "VK_KHR_push_descriptor extension not supported");
 
        const VkDescriptorSetLayoutCreateInfo   descriptorSetLayoutCreateInfo   =
index bb34906be5f9ae63eceae6bdd2c35dc42c6aa98d..7fbc02906d6455915352fb5ecbf1cae40cd5ce55 100644 (file)
@@ -99,7 +99,7 @@ DE_INLINE bool operator==(const VkConformanceVersionKHR& a, const VkConformanceV
 void checkSupport (Context& context, const TestType config)
 {
        DE_UNREF(config);
-       context.requireDeviceExtension("VK_KHR_driver_properties");
+       context.requireDeviceFunctionality("VK_KHR_driver_properties");
 }
 
 void testDriverMatch (const VkPhysicalDeviceDriverPropertiesKHR& deviceDriverProperties)
index d0af63a9b1dc6af874937613a93f47820b25b3e9..2b68640bf22e086756c6c550bd9deba1338303d9 100644 (file)
@@ -1501,7 +1501,7 @@ tcu::TestStatus deviceMemoryBudgetProperties (Context& context)
        TestLog&                                                        log                     = context.getTestContext().getLog();
        deUint8                                                         buffer[sizeof(VkPhysicalDeviceMemoryBudgetPropertiesEXT) + GUARD_SIZE];
 
-       if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_memory_budget"))
+       if (!context.isDeviceFunctionalitySupported("VK_EXT_memory_budget"))
                TCU_THROW(NotSupportedError, "VK_EXT_memory_budget is not supported");
 
        VkPhysicalDeviceMemoryBudgetPropertiesEXT *budgetProps = reinterpret_cast<VkPhysicalDeviceMemoryBudgetPropertiesEXT *>(buffer);
@@ -1925,7 +1925,7 @@ void checkYcbcrApiSupport (Context& context)
 
        if (!vk::isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_sampler_ycbcr_conversion"))
        {
-               if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_sampler_ycbcr_conversion"))
+               if (!context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion"))
                        TCU_THROW(NotSupportedError, "VK_KHR_sampler_ycbcr_conversion is not supported");
 
                // Hard dependency for ycbcr
@@ -2506,7 +2506,7 @@ tcu::TestStatus imageFormatProperties (Context& context, const VkFormat format,
        const VkPhysicalDeviceFeatures& deviceFeatures          = context.getDeviceFeatures();
        const VkPhysicalDeviceLimits&   deviceLimits            = context.getDeviceProperties().limits;
        const VkFormatProperties                formatProperties        = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
-       const bool                                              hasKhrMaintenance1      = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1");
+       const bool                                              hasKhrMaintenance1      = context.isDeviceFunctionalitySupported("VK_KHR_maintenance1");
 
        const VkFormatFeatureFlags              supportedFeatures       = tiling == VK_IMAGE_TILING_LINEAR ? formatProperties.linearTilingFeatures : formatProperties.optimalTilingFeatures;
        const VkImageUsageFlags                 usageFlagSet            = getValidImageUsageFlags(supportedFeatures, hasKhrMaintenance1);
@@ -3607,31 +3607,31 @@ tcu::TestStatus testMandatoryExtensions (Context& context)
 
        // Instance extensions
        {
-               static const char*                                      mandatoryExtensions[]   =
+               static const string                                     mandatoryExtensions[]   =
                {
                        "VK_KHR_get_physical_device_properties2",
                };
                const vector<VkExtensionProperties>     extensions                              = enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL);
 
-               for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(mandatoryExtensions); ++ndx)
+               for (const auto ext : mandatoryExtensions)
                {
-                       if (!isInstanceExtensionSupported(context.getUsedApiVersion(), extensions, RequiredExtension(mandatoryExtensions[ndx])))
-                               results.fail(string(mandatoryExtensions[ndx]) + " is not supported");
+                       if (!context.isDeviceFunctionalitySupported(ext))
+                               results.fail(ext + " is not supported");
                }
        }
 
        // Device extensions
        {
-               static const char*                                      mandatoryExtensions[]   =
+               static const string                                     mandatoryExtensions[]   =
                {
                        "VK_KHR_maintenance1",
                };
                const vector<VkExtensionProperties>     extensions                              = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL);
 
-               for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(mandatoryExtensions); ++ndx)
+               for (const auto ext : mandatoryExtensions)
                {
-                       if (!isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, RequiredExtension(mandatoryExtensions[ndx])))
-                               results.fail(string(mandatoryExtensions[ndx]) + " is not supported");
+                       if (!context.isDeviceFunctionalitySupported(ext))
+                               results.fail(ext + " is not supported");
                }
        }
 
index 5521c213c036dffa1098b517e6a618d5336c9e2e..b23b1b3b806f8ac8dcda42472054784c2c118807 100644 (file)
@@ -584,7 +584,7 @@ ImageClearingTestInstance::ImageClearingTestInstance (Context& context, const Te
        , m_frameBuffer                         (m_isAttachmentFormat ? createFrameBuffer(*m_imageView, *m_renderPass, params.imageExtent.width, params.imageExtent.height, params.imageViewLayerRange.layerCount) : vk::Move<vk::VkFramebuffer>())
 {
        if (m_params.allocationKind == ALLOCATION_KIND_DEDICATED)
-               context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+               context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
 }
 
 ImageClearingTestInstance::ViewType ImageClearingTestInstance::getViewType (deUint32 imageLayerCount) const
index 88d5a5c005e6a1b1e68263de417a7f41a685af8e..1fccb37edfc95fd168873a3417a9cc9d6e8316d0 100644 (file)
@@ -475,7 +475,7 @@ public:
        {}
        virtual void                                                    checkSupport                                                    (Context&       ctx) const
        {
-               ctx.requireDeviceExtension("VK_KHR_maintenance3");
+               ctx.requireDeviceFunctionality("VK_KHR_maintenance3");
        }
        virtual TestInstance*                                   createInstance                                                  (Context&       ctx) const
        {
@@ -499,9 +499,8 @@ public:
                const auto&     device                  = m_context.getDevice();
                auto&           log                             = m_context.getTestContext().getLog();
                bool            iubSupported    = false;
-               bool            iubExtSupported = isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_EXT_inline_uniform_block");
 
-               if (iubExtSupported)
+               if (m_context.isDeviceFunctionalitySupported("VK_EXT_inline_uniform_block"))
                {
                        DevIubFeat      iubFeatures     =
                        {
@@ -644,7 +643,7 @@ public:
        {}
        virtual void                                                    checkSupport                                                    (Context&       ctx) const
        {
-               ctx.requireDeviceExtension("VK_KHR_maintenance3");
+               ctx.requireDeviceFunctionality("VK_KHR_maintenance3");
        }
        virtual TestInstance*                                   createInstance                                                  (Context&       ctx) const
        {
index 2063159d995b40bdc59a25b50e349fa478aea241..ecec39ad62a8d2b28e9285911dfba79493eb4b8b 100644 (file)
@@ -260,11 +260,10 @@ tcu::TestStatus InvarianceInstance::iterate (void)
        size_t                                                                  refSizes[testCycles];
        unsigned int                                                    order[testCycles];
        bool                                                                    success                                                 = true;
-       const std::vector<std::string>&                 extensions                                              = m_context.getDeviceExtensions();
        const deBool                                                    isDedicatedAllocationSupported  =
-               isDeviceExtensionSupported(m_context.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation");
+               m_context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation");
        const deBool                                                    isYcbcrSupported =
-               isDeviceExtensionSupported(m_context.getUsedApiVersion(), extensions, "VK_KHR_sampler_ycbcr_conversion");
+               m_context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion");
        std::vector<int>                                                optimalFormats;
        std::vector<int>                                                linearFormats;
        std::vector<int>                                                memoryTypes;
index a4cbb16325c08fafa821d9d712e6b051fda44d14..253f9d4cb01eae27490343abde498edd55a08e2d 100644 (file)
@@ -324,7 +324,7 @@ T alignToPowerOfTwo (T value, T align)
 
 inline bool hasDeviceExtension (Context& context, const string name)
 {
-       return isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), name);
+       return context.isDeviceFunctionalitySupported(name);
 }
 
 VkDeviceSize getPageTableSize (const PlatformMemoryLimits& limits, VkDeviceSize allocationSize)
@@ -476,13 +476,14 @@ struct Instance
        {
                vector<const char*>                                     extensionNamePtrs;
                const vector<VkExtensionProperties>     instanceExts = enumerateInstanceExtensionProperties(env.vkp, DE_NULL);
-               for (size_t extensionID = 0; extensionID < params.instanceExtensions.size(); extensionID++)
+               for (const auto& extName : params.instanceExtensions)
                {
-                       if (!isInstanceExtensionSupported(env.apiVersion, instanceExts, RequiredExtension(params.instanceExtensions[extensionID])))
-                               TCU_THROW(NotSupportedError, (params.instanceExtensions[extensionID] + " is not supported").c_str());
+                       bool extNotInCore = !isCoreInstanceExtension(env.apiVersion, extName);
+                       if (extNotInCore && !isExtensionSupported(instanceExts.begin(), instanceExts.end(), RequiredExtension(extName)))
+                               TCU_THROW(NotSupportedError, (extName + " is not supported").c_str());
 
-                       if (!isCoreInstanceExtension(env.apiVersion, params.instanceExtensions[extensionID]))
-                               extensionNamePtrs.push_back(params.instanceExtensions[extensionID].c_str());
+                       if (extNotInCore)
+                               extensionNamePtrs.push_back(extName.c_str());
                }
 
                const VkApplicationInfo         appInfo                 =
index 92b113666d5d424768c35d502c79ea3de966acde..36b4ba869095d43f8b2cbf99aea49b585566cabf 100644 (file)
@@ -175,7 +175,7 @@ void BufferAddressTestCase::checkSupport (Context& context) const
 
 #if ENABLE_RAYTRACING
        if (m_data.stage == STAGE_RAYGEN &&
-               !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_NV_ray_tracing"))
+               !context.isDeviceFunctionalitySupported("VK_NV_ray_tracing"))
        {
                TCU_THROW(NotSupportedError, "Ray tracing not supported");
        }
@@ -466,7 +466,7 @@ tcu::TestStatus BufferAddressTestInstance::iterate (void)
        deMemset(&rayTracingProperties, 0, sizeof(rayTracingProperties));
        rayTracingProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV;
 
-       if (isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_NV_ray_tracing"))
+       if (m_context.isDeviceFunctionalitySupported("VK_NV_ray_tracing"))
        {
                properties.pNext = &rayTracingProperties;
        }
index 00356dbf7d42311228f777a324afbe97a4b677c9..8be1206939e6c82b75056bae9235044c685d641d 100644 (file)
@@ -114,6 +114,38 @@ struct CaseDef
        VkFlags allPipelineStages;
 };
 
+static void getNeededFeatures(const Context&                                                                   context,
+                                                         VkPhysicalDeviceFeatures2&                                            features,
+                                                         VkPhysicalDeviceInlineUniformBlockFeaturesEXT&        inlineUniformFeatures,
+                                                         VkPhysicalDeviceDescriptorIndexingFeaturesEXT&        indexingFeatures)
+{
+       deMemset(&inlineUniformFeatures, 0, sizeof(inlineUniformFeatures));
+       inlineUniformFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT;
+
+       deMemset(&indexingFeatures, 0, sizeof(indexingFeatures));
+       indexingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
+
+       deMemset(&features, 0, sizeof(features));
+       features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
+
+       bool descriptorIndexing         = context.isDeviceFunctionalitySupported("VK_EXT_descriptor_indexing");
+       bool uniformBlock                       = context.isDeviceFunctionalitySupported("VK_EXT_inline_uniform_block");
+       if (descriptorIndexing && uniformBlock)
+       {
+               indexingFeatures.pNext = &inlineUniformFeatures;
+               features.pNext = &indexingFeatures;
+       }
+       else if (descriptorIndexing)
+       {
+               features.pNext = &indexingFeatures;
+       }
+       else if (uniformBlock)
+       {
+               features.pNext = &inlineUniformFeatures;
+       }
+
+       context.getInstanceInterface().getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &features);
+}
 
 class RandomLayout
 {
@@ -194,13 +226,13 @@ void DescriptorSetRandomTestCase::checkSupport(Context& context) const
        properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
        void ** pNextTail = &properties.pNext;
 
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
+       if (context.isDeviceFunctionalitySupported("VK_EXT_inline_uniform_block"))
        {
                *pNextTail = &inlineUniformProperties;
                pNextTail = &inlineUniformProperties.pNext;
        }
 
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_NV_ray_tracing"))
+       if (context.isDeviceFunctionalitySupported("VK_NV_ray_tracing"))
        {
                *pNextTail = &rayTracingProperties;
                pNextTail = &rayTracingProperties.pNext;
@@ -209,40 +241,17 @@ void DescriptorSetRandomTestCase::checkSupport(Context& context) const
 
        context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
 
-       VkPhysicalDeviceInlineUniformBlockFeaturesEXT inlineUniformFeatures;
-       deMemset(&inlineUniformFeatures, 0, sizeof(inlineUniformFeatures));
-       inlineUniformFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT;
-
-       VkPhysicalDeviceDescriptorIndexingFeaturesEXT indexingFeatures;
-       deMemset(&indexingFeatures, 0, sizeof(indexingFeatures));
-       indexingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
-
        VkPhysicalDeviceFeatures2 features;
-       deMemset(&features, 0, sizeof(features));
-       features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
-
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") &&
-               isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
-       {
-               indexingFeatures.pNext = &inlineUniformFeatures;
-               features.pNext = &indexingFeatures;
-       }
-       else if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing"))
-       {
-               features.pNext = &indexingFeatures;
-       }
-       else if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
-       {
-               features.pNext = &inlineUniformFeatures;
-       }
+       VkPhysicalDeviceDescriptorIndexingFeaturesEXT indexingFeatures;
+       VkPhysicalDeviceInlineUniformBlockFeaturesEXT inlineUniformFeatures;
+       getNeededFeatures(context, features, inlineUniformFeatures, indexingFeatures);
 
-       context.getInstanceInterface().getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &features);
        if (m_data.stage == STAGE_VERTEX && !features.features.vertexPipelineStoresAndAtomics)
        {
                return TCU_THROW(NotSupportedError, "Vertex pipeline stores and atomics not supported");
        }
        else if (m_data.stage == STAGE_RAYGEN &&
-               !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_NV_ray_tracing"))
+               !context.isDeviceFunctionalitySupported("VK_NV_ray_tracing"))
        {
                return TCU_THROW(NotSupportedError, "Ray tracing is not supported");
        }
@@ -860,39 +869,17 @@ tcu::TestStatus DescriptorSetRandomTestInstance::iterate (void)
        deMemset(&rayTracingProperties, 0, sizeof(rayTracingProperties));
        rayTracingProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV;
 
-       if (isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_NV_ray_tracing"))
+       if (m_context.isDeviceFunctionalitySupported("VK_NV_ray_tracing"))
        {
                properties.pNext = &rayTracingProperties;
        }
 
        m_context.getInstanceInterface().getPhysicalDeviceProperties2(m_context.getPhysicalDevice(), &properties);
 
+       VkPhysicalDeviceFeatures2 features;
        VkPhysicalDeviceInlineUniformBlockFeaturesEXT inlineUniformFeatures;
-       deMemset(&inlineUniformFeatures, 0, sizeof(inlineUniformFeatures));
-       inlineUniformFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT;
-
        VkPhysicalDeviceDescriptorIndexingFeaturesEXT indexingFeatures;
-       deMemset(&indexingFeatures, 0, sizeof(indexingFeatures));
-       indexingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
-
-       VkPhysicalDeviceFeatures2 features;
-       deMemset(&features, 0, sizeof(features));
-       features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
-
-       if (isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") &&
-               isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
-       {
-               indexingFeatures.pNext = &inlineUniformFeatures;
-               features.pNext = &indexingFeatures;
-       }
-       else if (isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_EXT_descriptor_indexing"))
-       {
-               features.pNext = &indexingFeatures;
-       }
-       else if (isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
-       {
-               features.pNext = &inlineUniformFeatures;
-       }
+       getNeededFeatures(m_context, features, inlineUniformFeatures, indexingFeatures);
 
        m_context.getInstanceInterface().getPhysicalDeviceFeatures2(m_context.getPhysicalDevice(), &features);
 
index 073e189aead65b58235de55fe643bd415df7b5f8..cb9d664354b34f0aec516c92c4d94edb6e7b5b87 100644 (file)
@@ -739,7 +739,7 @@ tcu::TestStatus testLargePoints (Context& context)
 
        bool pointClippingOutside = true;
 
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2"))
+       if (context.isDeviceFunctionalitySupported("VK_KHR_maintenance2"))
        {
                VkPointClippingBehavior clippingBehavior = getClippingBehavior(context.getInstanceInterface(), context.getPhysicalDevice());
 
index 721d4a7ad06d4bded492c07f4d20284b5977ab2d..0ce3e11b2f1e2ff3ea66de9772d8259c4cea09ec 100644 (file)
@@ -1352,7 +1352,7 @@ struct AddProgramsUpdateBufferUsingRendering
 
 void checkSupport (Context& context)
 {
-       context.requireDeviceExtension("VK_EXT_conditional_rendering");
+       context.requireDeviceFunctionality("VK_EXT_conditional_rendering");
 }
 
 } // unnamed namespace
index 8f63a669bbae230a80b5b633673b103cb5628de9..feb50995cb3bdd216ec4838183fae99bcb595bec 100644 (file)
@@ -33,7 +33,7 @@ namespace conditional
 
 void checkConditionalRenderingCapabilities (vkt::Context& context, const ConditionalData& data)
 {
-       if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_conditional_rendering"))
+       if (!context.isDeviceFunctionalitySupported("VK_EXT_conditional_rendering"))
                TCU_THROW(NotSupportedError, "Missing extension: VK_EXT_conditional_rendering");
 
        if (data.conditionInherited)
index 91e204a285c9efd1bf83848b25c66c59a5c52c70..14440cfb895155239b0f82a8663e24479b7e626f 100644 (file)
@@ -2999,7 +2999,7 @@ public:
 
        virtual void checkSupport (vkt::Context& context) const
        {
-               context.requireDeviceExtension("VK_EXT_descriptor_indexing");
+               context.requireDeviceFunctionality("VK_EXT_descriptor_indexing");
 
                const vk::VkPhysicalDeviceDescriptorIndexingFeaturesEXT& feats = context.getDescriptorIndexingFeatures();
 
index 9f25b8d5e37659cbc18ec0933e8c4e100fea371b..48c0000231144c3d90f517ed9240645167a5f815 100644 (file)
@@ -211,7 +211,7 @@ bool DeviceGroupTestInstance::isPeerFetchAllowed (deUint32 memoryTypeIndex, deUi
 
 void DeviceGroupTestInstance::init (void)
 {
-       if (!isInstanceExtensionSupported(m_context.getUsedApiVersion(), m_context.getInstanceExtensions(), "VK_KHR_device_group_creation"))
+       if (!m_context.isInstanceFunctionalitySupported("VK_KHR_device_group_creation"))
                TCU_THROW(NotSupportedError, "Device Group tests are not supported, no device group extension present.");
 
        const InstanceInterface&                instanceInterface       = m_context.getInstanceInterface();
@@ -224,7 +224,7 @@ void DeviceGroupTestInstance::init (void)
        vector<string>                                  deviceExtensions;
        vector<string>                                  enabledLayers;
 
-       if (!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_device_group"))
+       if (!m_context.isDeviceFunctionalitySupported("VK_KHR_device_group"))
                TCU_THROW(NotSupportedError, "Missing extension: VK_KHR_device_group");
 
        if (!isCoreDeviceExtension(m_context.getUsedApiVersion(), "VK_KHR_device_group"))
@@ -232,7 +232,7 @@ void DeviceGroupTestInstance::init (void)
 
        if(m_useDedicated)
        {
-               if (!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_dedicated_allocation"))
+               if (!m_context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
                        TCU_THROW(NotSupportedError, "Missing extension: VK_KHR_dedicated_allocation");
 
                if (!isCoreDeviceExtension(m_context.getUsedApiVersion(), "VK_KHR_dedicated_allocation"))
index 92c7addcf6194b25ff503748cc4488a5d86b9e48..375ed88130d55fae4a08a6ca0a0ee8093a5eb4c7 100644 (file)
@@ -676,7 +676,7 @@ void DiscardRectanglesTestCase::initPrograms(SourceCollections& programCollectio
 
 void DiscardRectanglesTestCase::checkSupport (Context& context) const
 {
-       context.requireDeviceExtension("VK_EXT_discard_rectangles");
+       context.requireDeviceFunctionality("VK_EXT_discard_rectangles");
 }
 
 TestInstance* DiscardRectanglesTestCase::createInstance (Context& context) const
index f1877dacf0a4c23e70b8ce875a5e948c7606432f..d938af23bb086130d235579c1d4cbe8e4e8058c5 100644 (file)
@@ -919,7 +919,7 @@ tcu::TestStatus IndirectDrawInstanced<FirstInstanceSupport>::iterate (void)
 
 void checkIndirectCountExt (Context& context)
 {
-       context.requireDeviceExtension("VK_KHR_draw_indirect_count");
+       context.requireDeviceFunctionality("VK_KHR_draw_indirect_count");
 }
 
 }      // anonymous
index e45977904880c923c026be35f06455a018d77127..d4a75cfd0316d3aaca1d72e93ae75c6b086c802d 100644 (file)
@@ -290,7 +290,7 @@ public:
        {
                if (m_params.testAttribDivisor)
                {
-                       context.requireDeviceExtension("VK_EXT_vertex_attribute_divisor");
+                       context.requireDeviceFunctionality("VK_EXT_vertex_attribute_divisor");
 
                        const vk::VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT& vertexAttributeDivisorFeatures = context.getVertexAttributeDivisorFeatures();
 
@@ -302,7 +302,7 @@ public:
 
                        if (m_params.testMultiview)
                        {
-                               context.requireDeviceExtension("VK_KHR_multiview");
+                               context.requireDeviceFunctionality("VK_KHR_multiview");
 
                                const vk::VkPhysicalDeviceMultiviewFeatures& multiviewFeatures = context.getMultiviewFeatures();
 
index 2ce792deab11225d322ca8d096f2739f0a307bae..678fa1cacb0bcc32a7aee13b73ca25ad13574e68 100644 (file)
@@ -394,7 +394,7 @@ public:
                        context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_DEPTH_CLAMP);
 
                if (m_params.minDepth > 1.0f || m_params.minDepth < 0.0f || m_params.maxDepth > 1.0f || m_params.maxDepth < 0.0f)
-                       context.requireDeviceExtension("VK_EXT_depth_range_unrestricted");
+                       context.requireDeviceFunctionality("VK_EXT_depth_range_unrestricted");
        }
 
        virtual TestInstance* createInstance (Context& context) const
index 5571350d4a5a05e3e49f98044c5301116ddb77fc..d7d25fa5a5c885850ec7c72492ee9348512743a7 100644 (file)
@@ -500,7 +500,7 @@ public:
 
        virtual void checkSupport (Context& context) const
        {
-               context.requireDeviceExtension("VK_KHR_maintenance1");
+               context.requireDeviceFunctionality("VK_KHR_maintenance1");
        }
 
        virtual TestInstance* createInstance (Context& context) const
index 4b120d2ea9be8600de79e9db7c24a2e8cd3f7c04..37410464797bd85b9aceea236148be880155b347 100644 (file)
@@ -313,7 +313,7 @@ tcu::TestStatus DrawTest::iterate (void)
 
 void checkSupport (Context& context, TestFlags flags)
 {
-       context.requireDeviceExtension("VK_KHR_shader_draw_parameters");
+       context.requireDeviceFunctionality("VK_KHR_shader_draw_parameters");
 
        // Shader draw parameters is part of Vulkan 1.1 but is optional
        if (context.contextSupports(vk::ApiVersion(1, 1, 0)) )
index 674fcf381071fa43d98dc16082a0451e8dd6bf29..ee87595ed031b0470e637ad8fa9309aa5b750a06 100644 (file)
@@ -706,7 +706,7 @@ private:
 void checkRequirements (Context& context, const int)
 {
        context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_MULTI_VIEWPORT);
-       context.requireDeviceExtension("VK_EXT_shader_viewport_index_layer");
+       context.requireDeviceFunctionality("VK_EXT_shader_viewport_index_layer");
 
        const VkPhysicalDeviceLimits    limits  = context.getDeviceProperties().limits;
 
index fbd05012073641512c34943cc4c5a6b21ed2fde3..53275e5f98ea89bab8adf387f6728c322affe5b4 100644 (file)
@@ -796,7 +796,7 @@ tcu::TestStatus testTessellationShader (Context& context, const int numViewports
 void checkSupportVertex (Context& context, const int)
 {
        context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_MULTI_VIEWPORT);
-       context.requireDeviceExtension("VK_EXT_shader_viewport_index_layer");
+       context.requireDeviceFunctionality("VK_EXT_shader_viewport_index_layer");
 
        if (context.getDeviceProperties().limits.maxViewports < MIN_MAX_VIEWPORTS)
                TCU_FAIL("multiViewport supported but maxViewports is less than the minimum required");
index 5cc8c00cdec088d0fea517082377897852618c21..f7ccb375b11fa5e052c19e4c24d9c386cb23fe27 100644 (file)
@@ -151,7 +151,7 @@ FSITestCase::~FSITestCase   (void)
 
 void FSITestCase::checkSupport(Context& context) const
 {
-       context.requireDeviceExtension("VK_EXT_fragment_shader_interlock");
+       context.requireDeviceFunctionality("VK_EXT_fragment_shader_interlock");
 
        if ((m_data.interlock == INT_SAMPLE_ORDERED || m_data.interlock == INT_SAMPLE_UNORDERED) &&
                !context.getFragmentShaderInterlockFeatures().fragmentShaderSampleInterlock)
index 50368677e2a090822085dcfcf34b6a404a5f096e..f6173bad8b15fb5acaa4f63ae9533d954e2b9485 100644 (file)
@@ -1743,7 +1743,7 @@ void checkSupport (Context& context, const TestParams params)
        context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER);
 
        if (params.image.viewType == VK_IMAGE_VIEW_TYPE_3D)
-               context.requireDeviceExtension("VK_KHR_maintenance1");
+               context.requireDeviceFunctionality("VK_KHR_maintenance1");
 
        if (params.testType == TEST_TYPE_SECONDARY_CMD_BUFFER)
                context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_FRAGMENT_STORES_AND_ATOMICS);
index 0d7c25297eb70da40b2515e177c14bc0106b8c3e..6f5a7b8e77522fa56619fb3580beb9f4b994196b 100644 (file)
@@ -2849,7 +2849,7 @@ void TexelViewCompatibleCase::checkSupport (Context& context) const
        const VkPhysicalDevice                  physicalDevice                  = context.getPhysicalDevice();
        const InstanceInterface&                vk                                              = context.getInstanceInterface();
 
-       context.requireDeviceExtension("VK_KHR_maintenance2");
+       context.requireDeviceFunctionality("VK_KHR_maintenance2");
 
        {
                VkImageFormatProperties imageFormatProperties;
index bc122db77f0bfd14c9ed2b299c88e56c99a580cc..44eff95107f75d4b697676467a3e6a816287dfb7 100644 (file)
@@ -1753,7 +1753,7 @@ void ImageExtendOperandTest::checkSupport (Context& context) const
                                                                                                                                                                                           context.getPhysicalDevice(),
                                                                                                                                                                                           m_format));
 
-       if (!context.requireDeviceExtension("VK_KHR_spirv_1_4"))
+       if (!context.requireDeviceFunctionality("VK_KHR_spirv_1_4"))
                TCU_THROW(NotSupportedError, "VK_KHR_spirv_1_4 not supported");
 
        if ((m_texture.type() != IMAGE_TYPE_BUFFER) && !(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT))
index 1921987a0f505df40979de649571cd0cd34e61ce..0cac4d8e424da977290d58569d4beed93de472d9 100644 (file)
@@ -867,7 +867,7 @@ class UploadDownloadExecutor
 public:
        UploadDownloadExecutor(Context& context, VkDevice device, VkQueue queue, deUint32 queueFamilyIndex, const CaseDef& caseSpec) :
        m_caseDef(caseSpec),
-       m_haveMaintenance2(isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")),
+       m_haveMaintenance2(context.isDeviceFunctionalitySupported("VK_KHR_maintenance2")),
        m_vk(context.getDeviceInterface()),
        m_device(device),
        m_queue(queue),
@@ -1651,7 +1651,7 @@ void checkSupport (Context& context, const CaseDef caseDef)
 
        // If this is a VK_KHR_image_format_list test, check that the extension is supported
        if (caseDef.isFormatListTest)
-               context.requireDeviceExtension("VK_KHR_image_format_list");
+               context.requireDeviceFunctionality("VK_KHR_image_format_list");
 
        // Check required features on the format for the required upload/download methods
        VkFormatProperties      imageFormatProps, viewFormatProps;
@@ -1706,7 +1706,7 @@ void checkSupport (Context& context, const CaseDef caseDef)
        if ((viewFormatProps.optimalTilingFeatures & viewFormatFeatureFlags) != viewFormatFeatureFlags)
                TCU_THROW(NotSupportedError, "View format doesn't support upload/download method");
 
-       const bool haveMaintenance2 = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2");
+       const bool haveMaintenance2 = context.isDeviceFunctionalitySupported("VK_KHR_maintenance2");
 
        // We don't use the base image for anything other than transfer
        // operations so there are no features to check.  However, The Vulkan
index 1139bd329eca95690169f6d715f0d0220506108c..3ca5d03fad8ba900ced1fb3e6fd7b138caea5deb 100644 (file)
@@ -846,7 +846,7 @@ bool ImageTranscodingCase::isFormatUsageFlagSupported (Context& context, const V
 
 void ImageTranscodingCase::checkSupport (Context& context) const
 {
-       context.requireDeviceExtension("VK_KHR_maintenance2");
+       context.requireDeviceFunctionality("VK_KHR_maintenance2");
 
        if (!isFormatUsageFlagSupported(context, m_parameters.featuredFormat, m_parameters.testedImageUsageFeature))
                TCU_THROW(NotSupportedError, "Test skipped due to feature is not supported by the format");
index c5549ba579160c649c103369f5fadf9dc8a04340..7b44df9484896d982d377cf7904e42acd07ab582 100644 (file)
@@ -953,7 +953,7 @@ protected:
 
 ColorImagelessTestInstance::ColorImagelessTestInstance (Context& context, const TestParameters& parameters)
        : TestInstance                          (context)
-       , m_extensions                          (context.requireDeviceExtension("VK_KHR_imageless_framebuffer"))
+       , m_extensions                          (context.requireDeviceFunctionality("VK_KHR_imageless_framebuffer"))
        , m_imageExtent2D                       (makeExtent2D(32u, 32u))
        , m_parameters                          (parameters)
        , m_colorImageUsage                     (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT)
@@ -1748,7 +1748,7 @@ protected:
 DepthResolveImagelessTestInstance::DepthResolveImagelessTestInstance (Context& context, const TestParameters& parameters)
        : DepthImagelessTestInstance    (context, parameters)
 {
-       context.requireDeviceExtension("VK_KHR_depth_stencil_resolve");
+       context.requireDeviceFunctionality("VK_KHR_depth_stencil_resolve");
 
        const InstanceInterface&                                                        vki                                     = m_context.getInstanceInterface();
        const VkPhysicalDevice                                                          physDevice                      = m_context.getPhysicalDevice();
index 7e5bc54d5abc6c4b872ebdd27f4688f9a5f9cda1..27815e1a2e880034d265282600ec824188353517 100644 (file)
@@ -951,7 +951,7 @@ public:
 
        virtual void                                            checkSupport                                            (Context&                               ctx) const
        {
-               ctx.requireDeviceExtension("VK_KHR_bind_memory2");
+               ctx.requireDeviceFunctionality("VK_KHR_bind_memory2");
 
                if (m_params.usePriority && !ctx.getMemoryPriorityFeatures().memoryPriority)
                        TCU_THROW(NotSupportedError, "VK_EXT_memory_priority Not supported");
index 6040faa2db8b121a7d5fbc301520ded655e811cd..6b5341a584e3c166e35daa7a146eab29afbb97a0 100644 (file)
@@ -1049,7 +1049,7 @@ struct FormatName
 
 void checkSupport (Context& context)
 {
-       context.requireDeviceExtension("VK_EXT_external_memory_host");
+       context.requireDeviceFunctionality("VK_EXT_external_memory_host");
 }
 
 } // unnamed namespace
index 19c76c8ce59c1282a8ae17b0d51ce1b41fd43b23..14c49214d11b3b05c85c7322bf75f5ada043dc91 100644 (file)
@@ -1627,7 +1627,7 @@ void checkSupport (Context& context, TestConfig config)
        if (config.allocationKind == ALLOCATION_KIND_DEDICATED_IMAGE
                || config.allocationKind == ALLOCATION_KIND_DEDICATED_BUFFER)
        {
-               context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+               context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
        }
 }
 
index 82d85d6a1ba89d3b9aefbed5efcd68dce9bd1305..cea8fda6936e4de4649bae10b693e1ddbcd2eab0 100644 (file)
@@ -453,7 +453,7 @@ void checkSupportBufferMemoryRequirementsExtended (Context& context, VkBufferCre
 {
        checkSupportBufferMemoryRequirementsOriginal(context, flags);
 
-       context.requireDeviceExtension("VK_KHR_get_memory_requirements2");
+       context.requireDeviceFunctionality("VK_KHR_get_memory_requirements2");
 }
 
 void BufferMemoryRequirementsExtended::addFunctionTestCase (tcu::TestCaseGroup*        group,
@@ -526,7 +526,7 @@ void checkSupportBufferMemoryRequirementsDedicatedAllocation (Context& context,
 {
        checkSupportBufferMemoryRequirementsExtended(context, flags);
 
-       context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+       context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
 }
 
 void BufferMemoryRequirementsDedicatedAllocation::addFunctionTestCase (tcu::TestCaseGroup*     group,
@@ -656,10 +656,9 @@ protected:
                                                                                         const VkPhysicalDeviceMemoryProperties&        deviceMemoryProperties);
 
 private:
-       virtual bool isImageSupported                   (const deUint32                                                         apiVersion,
+       virtual bool isImageSupported                   (const Context&                                                         context,
                                                                                         const InstanceInterface&                                       vki,
                                                                                         const VkPhysicalDevice                                         physDevice,
-                                                                                        const std::vector<std::string>&                        deviceExtensions,
                                                                                         const VkImageCreateInfo&                                       info);
 
        virtual bool isFormatMatchingAspect             (const VkFormat                                                         format,
@@ -816,7 +815,7 @@ bool isUsageMatchesFeatures (const VkImageUsageFlags usage, const VkFormatFeatur
 }
 
 //! This catches both invalid as well as legal but unsupported combinations of image parameters
-bool ImageMemoryRequirementsOriginal::isImageSupported (const deUint32 apiVersion, const InstanceInterface& vki, const VkPhysicalDevice physDevice, const std::vector<std::string>& deviceExtensions, const VkImageCreateInfo& info)
+bool ImageMemoryRequirementsOriginal::isImageSupported (const Context& context, const InstanceInterface& vki, const VkPhysicalDevice physDevice, const VkImageCreateInfo& info)
 {
        DE_ASSERT(info.extent.width >= 1u && info.extent.height >= 1u && info.extent.depth >= 1u);
 
@@ -825,7 +824,7 @@ bool ImageMemoryRequirementsOriginal::isImageSupported (const deUint32 apiVersio
                        || info.mipLevels != 1
                        || info.arrayLayers != 1
                        || info.samples != VK_SAMPLE_COUNT_1_BIT))
-                       || !isDeviceExtensionSupported(apiVersion, deviceExtensions, "VK_KHR_sampler_ycbcr_conversion"))
+                       || !context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion"))
        {
                return false;
        }
@@ -1315,7 +1314,7 @@ tcu::TestStatus ImageMemoryRequirementsOriginal::execTest (Context& context, con
 
                                        m_currentTestImageInfo = imageInfo;
 
-                                       if (!isImageSupported(context.getUsedApiVersion(), vki, physDevice, context.getDeviceExtensions(), m_currentTestImageInfo))
+                                       if (!isImageSupported(context, vki, physDevice, m_currentTestImageInfo))
                                                continue;
 
                                        log << tcu::TestLog::Message << "- " << getImageInfoString(m_currentTestImageInfo) << tcu::TestLog::EndMessage;
@@ -1375,7 +1374,7 @@ void checkSupportImageMemoryRequirementsExtended (Context& context, ImageTestPar
 {
        checkSupportImageMemoryRequirementsOriginal(context, params);
 
-       context.requireDeviceExtension("VK_KHR_get_memory_requirements2");
+       context.requireDeviceFunctionality("VK_KHR_get_memory_requirements2");
 }
 
 void ImageMemoryRequirementsExtended::addFunctionTestCase (tcu::TestCaseGroup*         group,
@@ -1428,7 +1427,7 @@ void checkSupportImageMemoryRequirementsDedicatedAllocation (Context& context, I
 {
        checkSupportImageMemoryRequirementsExtended(context, params);
 
-       context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+       context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
 }
 
 void ImageMemoryRequirementsDedicatedAllocation::addFunctionTestCase (tcu::TestCaseGroup*              group,
@@ -1684,8 +1683,8 @@ void checkSupportMultiplane (Context& context, ImageTestParams params)
 {
        checkSupportImageMemoryRequirementsOriginal(context, params);
 
-       context.requireDeviceExtension("VK_KHR_get_memory_requirements2");
-       context.requireDeviceExtension("VK_KHR_sampler_ycbcr_conversion");
+       context.requireDeviceFunctionality("VK_KHR_get_memory_requirements2");
+       context.requireDeviceFunctionality("VK_KHR_sampler_ycbcr_conversion");
 }
 
 void populateMultiplaneTestGroup (tcu::TestCaseGroup* group)
index 6611e5a22da79991505d1c35ef029e42032e43a8..22257268d7260bdbb6c9858cbd9d995c80e51a64 100644 (file)
@@ -318,7 +318,7 @@ protected:
 
 MultiViewRenderTestInstance::MultiViewRenderTestInstance (Context& context, const TestParameters& parameters)
        : TestInstance                  (context)
-       , m_extensionSupported  ((parameters.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+       , m_extensionSupported  ((parameters.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
        , m_parameters                  (fillMissingParameters(parameters))
        , m_seed                                (context.getTestContext().getCommandLine().getBaseSeed())
        , m_squareCount                 (4u)
@@ -3364,7 +3364,7 @@ private:
 
        virtual void            checkSupport            (Context& context) const
        {
-               context.requireDeviceExtension("VK_KHR_multiview");
+               context.requireDeviceFunctionality("VK_KHR_multiview");
        }
 
        void                            initPrograms            (SourceCollections& programCollection) const
index 95b395244e032fa37cf391e70649a4d586d3df17..8447b1074b77920d002da63e5d8a923c8d971856 100644 (file)
@@ -528,7 +528,7 @@ CacheTestInstance::CacheTestInstance (Context&                                      context,
                                                                          const CacheTestParam* param)
        : TestInstance          (context)
        , m_param                       (param)
-       , m_extensions          (m_context.requireDeviceExtension("VK_EXT_pipeline_creation_feedback"))
+       , m_extensions          (m_context.requireDeviceFunctionality("VK_EXT_pipeline_creation_feedback"))
 {
        const DeviceInterface&  vk                              = m_context.getDeviceInterface();
        const VkDevice                  vkDevice                = m_context.getDevice();
index eea59f517d57b16449a358f41dccf849c79e191c..fc22f935b9c43150187d596fb6e952fc08ea89c3 100644 (file)
@@ -794,7 +794,7 @@ DepthRangeUnrestrictedTestInstance::DepthRangeUnrestrictedTestInstance      (Context&
                                                                                                                                                 const DepthRangeUnrestrictedParam      param)
        : TestInstance                  (context)
        , m_param                               (param)
-       , m_extensions                  (m_context.requireDeviceExtension("VK_EXT_depth_range_unrestricted"))
+       , m_extensions                  (m_context.requireDeviceFunctionality("VK_EXT_depth_range_unrestricted"))
        , m_renderSize                  (tcu::UVec2(32,32))
        , m_colorFormat                 (VK_FORMAT_R8G8B8A8_UNORM)
        , m_shaderStageCount    (0)
index 9543ea5cd3870cb3f29a9492a69c71b2bb47917a..54e94563f42267581c0c95f0771ab1a609594ff7 100644 (file)
@@ -575,7 +575,7 @@ ExecutablePropertiesTestInstance::ExecutablePropertiesTestInstance (Context&
                                                                                                const ExecutablePropertiesTestParam*    param)
        : TestInstance          (context)
        , m_param                       (param)
-       , m_extensions          (m_context.requireDeviceExtension("VK_KHR_pipeline_executable_properties"))
+       , m_extensions          (m_context.requireDeviceFunctionality("VK_KHR_pipeline_executable_properties"))
 {
        const DeviceInterface&  vk                              = m_context.getDeviceInterface();
        const VkDevice                  vkDevice                = m_context.getDevice();
index 44d7873e67cbb0ff6ccd74aef3c391ced45b275b..58d9eb1984704302ddb5c12e90f7e58453c0f587 100644 (file)
@@ -205,8 +205,8 @@ void checkSupportImageSamplingInstance (Context& context, ImageSamplingInstanceP
 
        if (params.separateStencilUsage)
        {
-               context.requireDeviceExtension("VK_EXT_separate_stencil_usage");
-               context.requireInstanceExtension("VK_KHR_get_physical_device_properties2");
+               context.requireDeviceFunctionality("VK_EXT_separate_stencil_usage");
+               context.requireInstanceFunctionality("VK_KHR_get_physical_device_properties2");
 
                const VkImageStencilUsageCreateInfoEXT  stencilUsage    =
                {
@@ -259,7 +259,7 @@ void checkSupportImageSamplingInstance (Context& context, ImageSamplingInstanceP
 
                if (nextType == VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT)
                {
-                       context.requireDeviceExtension("VK_EXT_sampler_filter_minmax");
+                       context.requireDeviceFunctionality("VK_EXT_sampler_filter_minmax");
 
                        if (!isMinMaxFilteringSupported(context.getInstanceInterface(), context.getPhysicalDevice(), params.imageFormat, VK_IMAGE_TILING_OPTIMAL))
                                throw tcu::NotSupportedError(std::string("Unsupported format for min/max filtering: ") + getFormatName(params.imageFormat));
@@ -270,7 +270,7 @@ void checkSupportImageSamplingInstance (Context& context, ImageSamplingInstanceP
                params.samplerParams.addressModeV == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE ||
                params.samplerParams.addressModeW == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE)
        {
-               context.requireDeviceExtension("VK_KHR_sampler_mirror_clamp_to_edge");
+               context.requireDeviceFunctionality("VK_KHR_sampler_mirror_clamp_to_edge");
        }
 
        if ((isCompressedFormat(params.imageFormat) || isDepthStencilFormat(params.imageFormat)) && params.imageViewType == VK_IMAGE_VIEW_TYPE_3D)
@@ -301,7 +301,7 @@ void checkSupportImageSamplingInstance (Context& context, ImageSamplingInstanceP
                context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_IMAGE_CUBE_ARRAY);
 
        if (params.allocationKind == ALLOCATION_KIND_DEDICATED)
-               context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+               context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
 }
 
 ImageSamplingInstance::ImageSamplingInstance (Context&                                         context,
index 9e728052566701e835d67ba2c9869dd7442a5fae..9af8969b167256e5030f24908469b1b6bd898c04 100644 (file)
@@ -226,7 +226,7 @@ InputAssemblyTest::InputAssemblyTest (tcu::TestContext&             testContext,
 void InputAssemblyTest::checkSupport (Context& context) const
 {
        if (m_indexType == VK_INDEX_TYPE_UINT8_EXT)
-               context.requireDeviceExtension("VK_EXT_index_type_uint8");
+               context.requireDeviceFunctionality("VK_EXT_index_type_uint8");
 
        switch (m_primitiveTopology)
        {
index 0be7e464ea47b68f2f611afc7fdbe4febdb83c8a..6067bd2f26ee4d1faffb857766dc0c9056e397c5 100644 (file)
@@ -140,7 +140,7 @@ void addInstanceTestCaseWithPrograms (tcu::TestCaseGroup*                                                           group,
 
 void checkSupportSampleLocations (Context& context)
 {
-       context.requireDeviceExtension("VK_EXT_sample_locations");
+       context.requireDeviceFunctionality("VK_EXT_sample_locations");
 }
 
 std::string getString (const VkSampleCountFlagBits sampleCount)
index fdeee4d28c4a7ac1d55d5da180599afe035c81c5..e184950c84c5266914e663ed14e6d6e7dec2117c 100644 (file)
@@ -1491,7 +1491,7 @@ void SampleMaskWithDepthTestTest::checkSupport (Context& context) const
        if (!context.getDeviceProperties().limits.standardSampleLocations)
                TCU_THROW(NotSupportedError, "standardSampleLocations required");
 
-       context.requireDeviceExtension("VK_EXT_post_depth_coverage");
+       context.requireDeviceFunctionality("VK_EXT_post_depth_coverage");
 }
 
 void SampleMaskWithDepthTestTest::initPrograms (SourceCollections& programCollection) const
index 2a73bbedbfd029b4072353a87704c4adb5ed8edf..859319d2d194cb672f14163181e7afcb92449e8a 100644 (file)
@@ -1213,7 +1213,7 @@ tcu::TestStatus testWithSizeReduction (Context& context, const CaseDef& caseDef)
 void checkImageViewTypeRequirements (Context& context, const VkImageViewType viewType)
 {
        if (viewType == VK_IMAGE_VIEW_TYPE_3D)
-               context.requireDeviceExtension("VK_KHR_maintenance1");
+               context.requireDeviceFunctionality("VK_KHR_maintenance1");
 
        if (viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY)
                context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_IMAGE_CUBE_ARRAY);
@@ -1224,7 +1224,7 @@ void checkSupportAttachmentSize (Context& context, const CaseDef caseDef)
        checkImageViewTypeRequirements(context, caseDef.viewType);
 
        if (caseDef.allocationKind == ALLOCATION_KIND_DEDICATED)
-               context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+               context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
 
        if (caseDef.depthStencilFormat != VK_FORMAT_UNDEFINED  && !isDepthStencilFormatSupported(context.getInstanceInterface(), context.getPhysicalDevice(), caseDef.depthStencilFormat))
                TCU_THROW(NotSupportedError, "Unsupported depth/stencil format");
@@ -1367,7 +1367,7 @@ void checkSupportRenderToMipMaps (Context& context, const CaseDef caseDef)
        checkImageViewTypeRequirements(context, caseDef.viewType);
 
        if (caseDef.allocationKind == ALLOCATION_KIND_DEDICATED)
-               context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+               context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
 
        if (caseDef.depthStencilFormat != VK_FORMAT_UNDEFINED  && !isDepthStencilFormatSupported(context.getInstanceInterface(), context.getPhysicalDevice(), caseDef.depthStencilFormat))
                TCU_THROW(NotSupportedError, "Unsupported depth/stencil format");
index e2ed6dde54d460c5f0945ce81c8e9a084a6f696d..a9e6cce0eb71c7c99d9509e3e238c190860453b3 100644 (file)
@@ -544,7 +544,7 @@ tcu::TestStatus testStencilExportReplace (Context& context)
 
 void checkSupport (Context& context)
 {
-       context.requireDeviceExtension("VK_EXT_shader_stencil_export");
+       context.requireDeviceFunctionality("VK_EXT_shader_stencil_export");
 
        const VkFormat stencilFormat = VK_FORMAT_S8_UINT;
        if (!isSupportedDepthStencilFormat(context.getInstanceInterface(), context.getPhysicalDevice(), stencilFormat))
index 1cdda8fa8cd0ae12d8af1bf0d9e82fd48da79ef2..55556721298a8da93211e3e7080f6dc62d531692 100644 (file)
@@ -703,7 +703,7 @@ void TimestampTest::checkSupport (Context& context) const
        if (m_hostQueryReset)
        {
                // Check VK_EXT_host_query_reset is supported
-               context.requireDeviceExtension("VK_EXT_host_query_reset");
+               context.requireDeviceFunctionality("VK_EXT_host_query_reset");
 
                if(context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
                        throw tcu::NotSupportedError("Implementation doesn't support resetting queries from the host");
@@ -1069,7 +1069,7 @@ vkt::TestInstance* CalibratedTimestampTest<T>::createInstance (Context& context)
 template <class T>
 void CalibratedTimestampTest<T>::checkSupport (Context& context) const
 {
-       context.requireDeviceExtension("VK_EXT_calibrated_timestamps");
+       context.requireDeviceFunctionality("VK_EXT_calibrated_timestamps");
 }
 
 CalibratedTimestampTestInstance::CalibratedTimestampTestInstance (Context& context)
index b13b00794118edfb59f622997fc3aeeb9be3e902..f5728e0c68ef56d356de77238a54412bbc280639 100644 (file)
@@ -56,12 +56,18 @@ CustomInstance makeProtectedMemInstance (vkt::Context& context, const std::vecto
        const Extensions                        supportedExtensions(vk::enumerateInstanceExtensionProperties(vkp, DE_NULL));
        std::vector<std::string>        requiredExtensions = extraExtensions;
 
-       if (!isCoreInstanceExtension(context.getUsedApiVersion(), "VK_KHR_get_physical_device_properties2"))
+       deUint32 apiVersion = context.getUsedApiVersion();
+       if (!isCoreInstanceExtension(apiVersion, "VK_KHR_get_physical_device_properties2"))
                requiredExtensions.push_back("VK_KHR_get_physical_device_properties2");
 
+       // extract extension names
+       std::vector<std::string> extensions;
+       for (const auto& e : supportedExtensions)
+               extensions.push_back(e.extensionName);
+
        for (const auto& extName : requiredExtensions)
        {
-               if (!isInstanceExtensionSupported(context.getUsedApiVersion(), supportedExtensions, vk::RequiredExtension(extName)))
+               if (!isInstanceExtensionSupported(apiVersion, extensions, extName))
                        TCU_THROW(NotSupportedError, (extName + " is not supported").c_str());
        }
 
@@ -148,10 +154,11 @@ vk::Move<vk::VkDevice> makeProtectedMemDevice     (const vk::PlatformInterface&           vkp
        // Check if the physical device supports the protected memory extension name
        for (deUint32 ndx = 0; ndx < extensions.size(); ++ndx)
        {
-               if (!isDeviceExtensionSupported(apiVersion, supportedExtensions, vk::RequiredExtension(extensions[ndx])))
+               bool notInCore = !isCoreDeviceExtension(apiVersion, extensions[ndx]);
+               if (notInCore && !isExtensionSupported(supportedExtensions.begin(), supportedExtensions.end(), RequiredExtension(extensions[ndx])))
                        TCU_THROW(NotSupportedError, (extensions[ndx] + " is not supported").c_str());
 
-               if (!isCoreDeviceExtension(apiVersion, extensions[ndx]))
+               if (notInCore)
                        requiredExtensions.push_back(extensions[ndx]);
        }
 
index 7be6768600e0bfffb0c6508b9dcb51bdc835da45..5c1a2b55d2f1ed4cc1a569822e23dccf46b63cba 100644 (file)
@@ -353,7 +353,7 @@ tcu::TestStatus     BasicOcclusionQueryTestInstance::iterate (void)
        if (m_testVector.queryResultsMode == RESULTS_MODE_GET_RESET)
        {
                // Check VK_EXT_host_query_reset is supported
-               m_context.requireDeviceExtension("VK_EXT_host_query_reset");
+               m_context.requireDeviceFunctionality("VK_EXT_host_query_reset");
                if(m_context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
                        throw tcu::NotSupportedError(std::string("Implementation doesn't support resetting queries from the host").c_str());
        }
@@ -601,7 +601,7 @@ tcu::TestStatus OcclusionQueryTestInstance::iterate (void)
        if (m_testVector.queryResultsMode == RESULTS_MODE_GET_RESET)
        {
                // Check VK_EXT_host_query_reset is supported
-               m_context.requireDeviceExtension("VK_EXT_host_query_reset");
+               m_context.requireDeviceFunctionality("VK_EXT_host_query_reset");
                if(m_context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
                        throw tcu::NotSupportedError(std::string("Implementation doesn't support resetting queries from the host").c_str());
        }
index 55277b7e93425ed9d0ce7ee4dd78e48c649d4abd..56385f1ad3e57418d570655bc334ff37d7969bdd 100644 (file)
@@ -331,7 +331,7 @@ void StatisticQueryTestInstance::checkExtensions (deBool hostResetQueryEnabled)
        if (hostResetQueryEnabled == DE_TRUE)
        {
                // Check VK_EXT_host_query_reset is supported
-               m_context.requireDeviceExtension("VK_EXT_host_query_reset");
+               m_context.requireDeviceFunctionality("VK_EXT_host_query_reset");
                if(m_context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
                        throw tcu::NotSupportedError(std::string("Implementation doesn't support resetting queries from the host").c_str());
        }
index cc44dbe592efb58d940c40c50df5b8c19343c986..db46bfa65e38ce557fb18aa77b831dd3118930be 100644 (file)
@@ -1027,7 +1027,7 @@ BaseLineTestInstance::BaseLineTestInstance (Context& context,
 {
        DE_ASSERT(m_primitiveWideness < PRIMITIVEWIDENESS_LAST);
 
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_line_rasterization"))
+       if (context.isDeviceFunctionalitySupported("VK_EXT_line_rasterization"))
        {
                VkPhysicalDeviceLineRasterizationPropertiesEXT lineRasterizationProperties =
                {
index b807f941f2b2d0f89e0e1375a4d24daf6350b105..c40801c511708309c9d316c9424177fd4325c887 100644 (file)
@@ -217,7 +217,7 @@ DepthStencilResolveTest::~DepthStencilResolveTest (void)
 
 bool DepthStencilResolveTest::isFeaturesSupported()
 {
-       m_context.requireDeviceExtension("VK_KHR_depth_stencil_resolve");
+       m_context.requireDeviceFunctionality("VK_KHR_depth_stencil_resolve");
        if (m_config.imageLayers > 1)
                m_context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER);
 
index 504c3be708febfe3d8a4562031bd496ffd7090ff..0d6188a45e0e91705dfca78ca239f8de56aeee1c 100644 (file)
@@ -185,7 +185,7 @@ protected:
 MultisampleRenderPassTestBase::MultisampleRenderPassTestBase (Context& context, TestConfig config, deUint32 attachmentsCount)
        : TestInstance                          (context)
        , m_featuresSupported           (featuresSupported(context, config))
-       , m_extensionSupported          ((config.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+       , m_extensionSupported          ((config.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
        , m_renderPassType                      (config.renderPassType)
        , m_format                                      (config.format)
        , m_sampleCount                         (sampleCountBitFromSampleCount(config.sampleCount))
index 3a9ec6099959faea64704fec127cf933db8eef02..65a9f6ab591055e945be0d9291070a440970c030 100644 (file)
@@ -1252,12 +1252,12 @@ bool isExtensionSupported(Context& context, RenderPassType renderPassType, TestS
 {
 
        if (renderPassType == RENDERPASS_TYPE_RENDERPASS2)
-               context.requireDeviceExtension("VK_KHR_create_renderpass2");
+               context.requireDeviceFunctionality("VK_KHR_create_renderpass2");
 
        if (separateStencilUsage)
        {
-               context.requireDeviceExtension  ("VK_EXT_separate_stencil_usage");
-               context.requireInstanceExtension("VK_KHR_get_physical_device_properties2");
+               context.requireDeviceFunctionality      ("VK_EXT_separate_stencil_usage");
+               context.requireInstanceFunctionality("VK_KHR_get_physical_device_properties2");
        }
 
        return true;
index 0fb447b5f611aa2e7197fe512fa9f6dcbcb87237..a45675eb1668fbd51b88cf8abc9db2646d1a56e3 100644 (file)
@@ -797,7 +797,7 @@ private:
 SampleReadTestInstance::SampleReadTestInstance (Context& context, TestConfig config)
        : TestInstance                                  (context)
        , m_extensionSupported                  (context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING) &&
-                                                                        ((config.renderPassType != RENDERPASS_TYPE_RENDERPASS2) || context.requireDeviceExtension("VK_KHR_create_renderpass2")))
+                                                                        ((config.renderPassType != RENDERPASS_TYPE_RENDERPASS2) || context.requireDeviceFunctionality("VK_KHR_create_renderpass2")))
        , m_renderPassType                              (config.renderPassType)
        , m_sampleCount                                 (config.sampleCount)
        , m_width                                               (32u)
index 62f9d6a7e3076a1f4c7e9ce57d8b6a63e7789b80..85e40e27624323d6ada95c10b264c5d7160cfa32 100644 (file)
@@ -410,7 +410,7 @@ private:
 
 SparseRenderTargetTestInstance::SparseRenderTargetTestInstance (Context& context, TestConfig testConfig)
        : TestInstance                          (context)
-       , m_extensionSupported          ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+       , m_extensionSupported          ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
        , m_renderPassType                      (testConfig.renderPassType)
        , m_width                                       (32u)
        , m_height                                      (32u)
index 365ded413e61f329f4840dd007ddfcb00b7b7bba..b4c91d24e0392f68017f5226e0ed877d2da9b0e5 100644 (file)
@@ -491,7 +491,7 @@ private:
 
 ExternalDependencyTestInstance::ExternalDependencyTestInstance (Context& context, ExternalTestConfig testConfig)
        : TestInstance                                  (context)
-       , m_extensionSupported                  ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+       , m_extensionSupported                  ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
        , m_renderPassType                              (testConfig.renderPassType)
        , m_width                                               (testConfig.imageSize.x())
        , m_height                                              (testConfig.imageSize.y())
@@ -1086,7 +1086,7 @@ private:
 
 SubpassDependencyTestInstance::SubpassDependencyTestInstance (Context& context, SubpassTestConfig testConfig)
        : TestInstance                                  (context)
-       , m_extensionSupported                  ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+       , m_extensionSupported                  ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
        , m_renderPassInfo                              (testConfig.renderPass)
        , m_renderPassType                              (testConfig.renderPassType)
        , m_width                                               (testConfig.imageSize.x())
@@ -1805,7 +1805,7 @@ private:
 
 SubpassSelfDependencyBackwardsTestInstance::SubpassSelfDependencyBackwardsTestInstance (Context& context, SubpassSelfDependencyBackwardsTestConfig testConfig)
        : TestInstance                  (context)
-       , m_extensionSupported  ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+       , m_extensionSupported  ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
        , m_featuresSupported   (context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER))
        , m_renderPassType              (testConfig.renderPassType)
        , m_width                               (testConfig.imageSize.x())
@@ -2264,7 +2264,7 @@ private:
 
 SeparateChannelsTestInstance::SeparateChannelsTestInstance (Context& context, SeparateChannelsTestConfig testConfig)
        : TestInstance                  (context)
-       , m_extensionSupported  ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+       , m_extensionSupported  ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
        , m_renderPassType              (testConfig.renderPassType)
        , m_width                               (256u)
        , m_height                              (256u)
index ba3b223a9175796e740f6ff41e281324880cace5..abbe78c4763bc470e20e473de2fe9dfc265e26be 100644 (file)
@@ -4519,17 +4519,17 @@ tcu::TestStatus renderPassTest (Context& context, TestConfig config)
        vector<SubpassRenderInfo>                       subpassRenderInfo;
 
        if (config.renderPassType == RENDERPASS_TYPE_RENDERPASS2)
-               context.requireDeviceExtension("VK_KHR_create_renderpass2");
+               context.requireDeviceFunctionality("VK_KHR_create_renderpass2");
 
        if (config.allocationKind == ALLOCATION_KIND_DEDICATED)
        {
-               if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation"))
+               if (!context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
                        TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported");
        }
 
        if (!renderPassInfo.getInputAspects().empty())
        {
-               if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2"))
+               if (!context.isDeviceFunctionalitySupported("VK_KHR_maintenance2"))
                        TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance2 not supported.");
        }
 
@@ -4590,7 +4590,7 @@ tcu::TestStatus renderPassTest (Context& context, TestConfig config)
                        }
                }
 
-               if (requireDepthStencilLayout && !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2"))
+               if (requireDepthStencilLayout && !context.isDeviceFunctionalitySupported("VK_KHR_maintenance2"))
                        TCU_THROW(NotSupportedError, "VK_KHR_maintenance2 is not supported");
        }
 
index 11ea07de29dc752c4bc773572ff0e5ea38d211f3..e8afdf73f8e6e01f751b237e93e5fb94c2238e9c 100644 (file)
@@ -361,7 +361,7 @@ UnusedAttachmentTestInstance::UnusedAttachmentTestInstance (Context&                        context,
 
        // Check for renderpass2 extension if used
        if (testParams.renderPassType == RENDERPASS_TYPE_RENDERPASS2)
-               context.requireDeviceExtension("VK_KHR_create_renderpass2");
+               context.requireDeviceFunctionality("VK_KHR_create_renderpass2");
 
        // Create color image
        {
index 01fec52913e4c00cf9470af598d49b74bdb79af3..8d68f43376185c247de2673c983171ab8d5ef643 100644 (file)
@@ -205,7 +205,7 @@ void UnusedClearAttachmentTest::checkSupport (Context& context) const
 {
        // Check for renderpass2 extension if used
        if (m_testParams.renderPassType == RENDERPASS_TYPE_RENDERPASS2)
-               context.requireDeviceExtension("VK_KHR_create_renderpass2");
+               context.requireDeviceFunctionality("VK_KHR_create_renderpass2");
 
        // Check support for the needed color, depth and stencil formats.
        if (!m_testParams.colorUsed.empty())
index 7ab9d7df58be2e3709a5f57f1cbfb46c776c3df2..5728ffb83706bd6452d87a92f84f68400c8abf86 100644 (file)
@@ -64,10 +64,7 @@ namespace
 {
 
 // A function for getting information on variable pointer features supported through physical device
-vk::VkPhysicalDeviceVariablePointersFeatures querySupportedVariablePointersFeatures (const deUint32                                    apiVersion,
-                                                                                                                                                                       const InstanceInterface&                vki,
-                                                                                                                                                                       VkPhysicalDevice                                device,
-                                                                                                                                                                       const std::vector<std::string>& instanceExtensions)
+vk::VkPhysicalDeviceVariablePointersFeatures querySupportedVariablePointersFeatures (const Context& context)
 {
        VkPhysicalDeviceVariablePointersFeatures extensionFeatures =
        {
@@ -83,9 +80,9 @@ vk::VkPhysicalDeviceVariablePointersFeatures querySupportedVariablePointersFeatu
        features.pNext = &extensionFeatures;
 
        // Call the getter only if supported. Otherwise above "zero" defaults are used
-       if (isInstanceExtensionSupported(apiVersion, instanceExtensions, "VK_KHR_get_physical_device_properties2"))
+       if (context.isInstanceFunctionalitySupported("VK_KHR_get_physical_device_properties2"))
        {
-               vki.getPhysicalDeviceFeatures2(device, &features);
+               context.getInstanceInterface().getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &features);
        }
 
        return extensionFeatures;
@@ -1231,7 +1228,7 @@ RobustReadTest::RobustReadTest (tcu::TestContext&         testContext,
 
 TestInstance* RobustReadTest::createInstance (Context& context) const
 {
-       VkPhysicalDeviceVariablePointersFeatures pointerFeatures = querySupportedVariablePointersFeatures(context.getUsedApiVersion(), context.getInstanceInterface(), context.getPhysicalDevice(), context.getInstanceExtensions());
+       VkPhysicalDeviceVariablePointersFeatures pointerFeatures = querySupportedVariablePointersFeatures(context);
 
        if (pointerFeatures.variablePointersStorageBuffer != DE_TRUE)
                return new NotSupportedInstance(context, std::string("VariablePointersStorageBuffer support is required for this test."));
@@ -1271,7 +1268,7 @@ RobustWriteTest::RobustWriteTest (tcu::TestContext&               testContext,
 
 TestInstance* RobustWriteTest::createInstance (Context& context) const
 {
-       VkPhysicalDeviceVariablePointersFeatures pointerFeatures = querySupportedVariablePointersFeatures(context.getUsedApiVersion(), context.getInstanceInterface(), context.getPhysicalDevice(), context.getInstanceExtensions());
+       VkPhysicalDeviceVariablePointersFeatures pointerFeatures = querySupportedVariablePointersFeatures(context);
        if (pointerFeatures.variablePointersStorageBuffer != DE_TRUE)
                return new NotSupportedInstance(context, std::string("VariablePointersStorageBuffer support is required for this test."));
 
index 8e461118ef6b6bf2b1ffe056a6a3deb19c12eeaf..ed3244a38e08980459a6e47770af74ae6352bfea 100644 (file)
@@ -468,7 +468,7 @@ AtomicOperationCaseInstance::AtomicOperationCaseInstance (Context&                          context,
 {
        if ((m_dataType == DATA_TYPE_INT64) || (m_dataType == DATA_TYPE_UINT64))
        {
-               if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_shader_atomic_int64"))
+               if (!context.isDeviceFunctionalitySupported("VK_KHR_shader_atomic_int64"))
                        TCU_THROW(NotSupportedError, "Missing extension: VK_KHR_shader_atomic_int64");
 
                VkPhysicalDeviceShaderAtomicInt64FeaturesKHR shaderAtomicInt64Features;
index f43a8ad960c364b23b6e74f5c56e6d446c9a469b..ab7d304c83f1e63437f32535b771a2bb21e0832f 100644 (file)
@@ -1209,7 +1209,7 @@ tcu::TestStatus BlockArrayIndexingCaseInstance::iterate (void)
 
        if ((m_flags & FLAG_USE_STORAGE_BUFFER) != 0)
        {
-               if (!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_storage_buffer_storage_class"))
+               if (!m_context.isDeviceFunctionalitySupported("VK_KHR_storage_buffer_storage_class"))
                        TCU_THROW(NotSupportedError, "VK_KHR_storage_buffer_storage_class is not supported");
        }
 
index 412b6c409debf94014cc57e14748729d6c996f0d..e89f07a832fe45ca6d6cd6a800153a8d90bf1aec 100644 (file)
@@ -122,7 +122,7 @@ public:
 private:
        void checkSupported(void)
        {
-               m_context.requireDeviceExtension("VK_KHR_shader_clock");
+               m_context.requireDeviceFunctionality("VK_KHR_shader_clock");
 
                VkPhysicalDeviceShaderClockFeaturesKHR shaderClockFeatures;
                shaderClockFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR;
index f440f1f4d86702f1beb8debea7f2df9dd3f8fdad..2c0a3e87f1b1c2054eb5d3340a070b60c1ace69e 100644 (file)
@@ -2751,8 +2751,7 @@ void TestGroupBuilderBase::setupVulkanFeatures(FloatType          inFloatType,
 // features are set to the same value when specific independence settings are used.
 tcu::TestStatus verifyIndependenceSettings(Context& context)
 {
-       const std::vector<std::string>& deviceExtensions = context.getDeviceExtensions();
-       if (!isDeviceExtensionSupported(context.getUsedApiVersion(), deviceExtensions, "VK_KHR_shader_float_controls"))
+       if (!context.isDeviceFunctionalitySupported("VK_KHR_shader_float_controls"))
                TCU_THROW(NotSupportedError, "VK_KHR_shader_float_controls not supported");
 
        vk::VkPhysicalDeviceFloatControlsPropertiesKHR  fcProperties;
index c51633132d912b9677e91230953466099df4eb9d..3182a79c5bc8ca7e46a8851a34f7f2ce25ab8610 100644 (file)
@@ -198,8 +198,7 @@ bool isFloatControlsFeaturesSupported (const Context& context, const ExtensionFl
                return true;
 
        // return false when float control features are requested and proper extension is not supported
-       const std::vector<std::string>& deviceExtensions = context.getDeviceExtensions();
-       if (!isDeviceExtensionSupported(context.getUsedApiVersion(), deviceExtensions, "VK_KHR_shader_float_controls"))
+       if (!context.isDeviceFunctionalitySupported("VK_KHR_shader_float_controls"))
                return false;
 
        // perform query to get supported float control properties
index b0f9ecc1cf7bc889a456211495c78881f3ee3450..e0ef17c0ee36fef2abe5e60ab04a10c8253f3b2f 100644 (file)
@@ -2537,7 +2537,7 @@ void SSBOLayoutCase::initPrograms (vk::SourceCollections& programCollection) con
 
 TestInstance* SSBOLayoutCase::createInstance (Context& context) const
 {
-       if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_relaxed_block_layout") && usesRelaxedLayout(m_interface))
+       if (!context.isDeviceFunctionalitySupported("VK_KHR_relaxed_block_layout") && usesRelaxedLayout(m_interface))
                TCU_THROW(NotSupportedError, "VK_KHR_relaxed_block_layout not supported");
        if (!context.get16BitStorageFeatures().storageBuffer16BitAccess && uses16BitStorage(m_interface))
                TCU_THROW(NotSupportedError, "storageBuffer16BitAccess not supported");
index 3e5e2536bacde46dc05daccf32b9aa6b170062f5..7e66faa6f6d1bbcde617d997ce42e22a4b2750aa 100755 (executable)
@@ -495,7 +495,7 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
        if (!subgroups::isFormatSupportedForDevice(context, caseDef.format))
                TCU_THROW(NotSupportedError, "Device does not support the specified format in subgroup operations");
 
-       if (caseDef.extShaderSubGroupBallotTests && !context.requireDeviceExtension("VK_EXT_shader_subgroup_ballot"))
+       if (caseDef.extShaderSubGroupBallotTests && !context.requireDeviceFunctionality("VK_EXT_shader_subgroup_ballot"))
        {
                TCU_THROW(NotSupportedError, "Device does not support VK_EXT_shader_subgroup_ballot extension");
        }
index 9c719e9cd96658be2754e2a0e41467616cc6eadb..9894e7672863bed1c7bd452c00bf6e1aa7c40ac5 100755 (executable)
@@ -390,7 +390,7 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
        if (!subgroups::isSubgroupSupported(context))
                TCU_THROW(NotSupportedError, "Subgroup operations are not supported");
 
-       if (!context.requireDeviceExtension("VK_EXT_shader_subgroup_ballot"))
+       if (!context.requireDeviceFunctionality("VK_EXT_shader_subgroup_ballot"))
        {
                TCU_THROW(NotSupportedError, "Device does not support VK_EXT_shader_subgroup_ballot extension");
        }
index 822428db7ed772cbb7b17997f03ba47f38664208..32648ab22c02b251ea2ec726a4fa6b55f06a87c7 100755 (executable)
@@ -904,7 +904,7 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
                TCU_THROW(NotSupportedError, "Device does not support subgroup ballot operations");
        }
 
-       if (caseDef.extShaderSubGroupBallotTests && !context.requireDeviceExtension("VK_EXT_shader_subgroup_ballot"))
+       if (caseDef.extShaderSubGroupBallotTests && !context.requireDeviceFunctionality("VK_EXT_shader_subgroup_ballot"))
        {
                TCU_THROW(NotSupportedError, "Device does not support VK_EXT_shader_subgroup_ballot extension");
        }
index 96b67f857418b1becf5f3d9a76039eb396687210..572387ed3011242a5806fc675ad8b491c37f876e 100644 (file)
@@ -1056,8 +1056,8 @@ bool vkt::subgroups::isFormatSupportedForDevice(Context& context, vk::VkFormat f
        features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
        features2.pNext = DE_NULL;
 
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_shader_subgroup_extended_types") &&
-               isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_shader_float16_int8"))
+       if (context.isDeviceFunctionalitySupported("VK_KHR_shader_subgroup_extended_types") &&
+               context.isDeviceFunctionalitySupported("VK_KHR_shader_float16_int8"))
        {
                features2.pNext = &subgroupExtendedTypesFeatures;
                subgroupExtendedTypesFeatures.pNext = &float16Int8Features;
index e4f895b5e1aec3142cb5aa6de3a8046417d4e347..d4308b3719a96fa5126156197915fbd30c4b640d 100755 (executable)
@@ -614,7 +614,7 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
        if (caseDef.opType > OPTYPE_LAST_NON_ARB)
        {
-               context.requireDeviceExtension("VK_EXT_shader_subgroup_vote");
+               context.requireDeviceFunctionality("VK_EXT_shader_subgroup_vote");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
@@ -641,7 +641,7 @@ tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
 
        if (caseDef.opType > OPTYPE_LAST_NON_ARB)
        {
-               context.requireDeviceExtension("VK_EXT_shader_subgroup_vote");
+               context.requireDeviceFunctionality("VK_EXT_shader_subgroup_vote");
        }
 
        subgroups::SSBOData inputData;
index 7929b9e9475a0ebfc324e0dd9a4250c5abaa2dd6..a6e9dcbed58026bfe1b332150e7f4035d57f373d 100644 (file)
@@ -333,25 +333,25 @@ vk::Move<vk::VkDevice> createTestDevice (const Context&                                   context,
        std::vector<deUint32>                                                   queueFamilyIndices              (queueFamilyProperties.size(), 0xFFFFFFFFu);
        std::vector<const char*>                                                extensions;
 
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation"))
+       if (context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
                extensions.push_back("VK_KHR_dedicated_allocation");
 
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_get_memory_requirements2"))
+       if (context.isDeviceFunctionalitySupported("VK_KHR_get_memory_requirements2"))
                extensions.push_back("VK_KHR_get_memory_requirements2");
 
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_semaphore"))
+       if (context.isDeviceFunctionalitySupported("VK_KHR_external_semaphore"))
                extensions.push_back("VK_KHR_external_semaphore");
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_memory"))
+       if (context.isDeviceFunctionalitySupported("VK_KHR_external_memory"))
                extensions.push_back("VK_KHR_external_memory");
 
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_semaphore_fd"))
+       if (context.isDeviceFunctionalitySupported("VK_KHR_external_semaphore_fd"))
                extensions.push_back("VK_KHR_external_semaphore_fd");
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_memory_fd"))
+       if (context.isDeviceFunctionalitySupported("VK_KHR_external_memory_fd"))
                extensions.push_back("VK_KHR_external_memory_fd");
 
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_semaphore_win32"))
+       if (context.isDeviceFunctionalitySupported("VK_KHR_external_semaphore_win32"))
                extensions.push_back("VK_KHR_external_semaphore_win32");
-       if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_memory_win32"))
+       if (context.isDeviceFunctionalitySupported("VK_KHR_external_memory_win32"))
                extensions.push_back("VK_KHR_external_memory_win32");
 
        if (timelineSemaphores)
@@ -1003,7 +1003,7 @@ SharingTestInstance::SharingTestInstance (Context&                context,
        , m_supportWriteOp                      (makeOperationSupport(config.writeOp, config.resource))
        , m_supportReadOp                       (makeOperationSupport(config.readOp, config.resource))
        , m_notSupportedChecker         (context, m_config, *m_supportWriteOp, *m_supportReadOp)
-       , m_getMemReq2Supported         (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_get_memory_requirements2"))
+       , m_getMemReq2Supported         (context.isDeviceFunctionalitySupported("VK_KHR_get_memory_requirements2"))
 
        , m_instanceAndDeviceA          (context, config)
        , m_instanceA                           (m_instanceAndDeviceA.getInstance())
@@ -1062,7 +1062,7 @@ tcu::TestStatus SharingTestInstance::iterate (void)
                const vk::Unique<vk::VkCommandBuffer>   commandBufferA          (createCommandBuffer(m_vkdA, *m_deviceA, *commandPoolA));
                vk::SimpleAllocator                                             allocatorA                      (m_vkdA, *m_deviceA, vk::getPhysicalDeviceMemoryProperties(m_vkiA, m_physicalDeviceA));
                const std::vector<std::string>                  deviceExtensionsA;
-               OperationContext                                                operationContextA       (m_context.getUsedApiVersion(), m_vkiA, m_vkdA, m_physicalDeviceA, *m_deviceA, allocatorA, deviceExtensionsA, m_context.getBinaryCollection(), m_pipelineCacheData);
+               OperationContext                                                operationContextA       (m_context, m_vkiA, m_vkdA, m_physicalDeviceA, *m_deviceA, allocatorA, deviceExtensionsA, m_context.getBinaryCollection(), m_pipelineCacheData);
 
                if (!checkQueueFlags(m_queueFamiliesA[m_queueANdx].queueFlags , m_supportWriteOp->getQueueFlags(operationContextA)))
                        TCU_THROW(NotSupportedError, "Operation not supported by the source queue");
@@ -1072,7 +1072,7 @@ tcu::TestStatus SharingTestInstance::iterate (void)
                const vk::Unique<vk::VkCommandBuffer>   commandBufferB          (createCommandBuffer(m_vkdB, *m_deviceB, *commandPoolB));
                vk::SimpleAllocator                                             allocatorB                      (m_vkdB, *m_deviceB, vk::getPhysicalDeviceMemoryProperties(m_vkiB, m_physicalDeviceB));
                const std::vector<std::string>                  deviceExtensionsB;
-               OperationContext                                                operationContextB       (m_context.getUsedApiVersion(), m_vkiB, m_vkdB, m_physicalDeviceB, *m_deviceB, allocatorB, deviceExtensionsB, m_context.getBinaryCollection(), m_pipelineCacheData);
+               OperationContext                                                operationContextB       (m_context, m_vkiB, m_vkdB, m_physicalDeviceB, *m_deviceB, allocatorB, deviceExtensionsB, m_context.getBinaryCollection(), m_pipelineCacheData);
 
                if (!checkQueueFlags(m_queueFamiliesB[m_queueBNdx].queueFlags , m_supportReadOp->getQueueFlags(operationContextB)))
                        TCU_THROW(NotSupportedError, "Operation not supported by the destination queue");
index de5a94dbb2ade4c009719b279c46d431f503ca51..8b552e893a80783f67903efc9eb3eed023f53033 100644 (file)
@@ -617,8 +617,7 @@ public:
 
        VkQueueFlags getQueueFlags (const OperationContext& context) const
        {
-               if (m_bufferOp == BUFFER_OP_FILL &&
-                       !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1"))
+               if (m_bufferOp == BUFFER_OP_FILL && !context.isDeviceFunctionalitySupported("VK_KHR_maintenance1"))
                {
                        return VK_QUEUE_COMPUTE_BIT | VK_QUEUE_GRAPHICS_BIT;
                }
@@ -4618,7 +4617,8 @@ private:
 } // anonymous ns
 
 OperationContext::OperationContext (Context& context, PipelineCacheData& pipelineCacheData)
-       : m_vki                                 (context.getInstanceInterface())
+       : m_context                             (context)
+       , m_vki                                 (context.getInstanceInterface())
        , m_vk                                  (context.getDeviceInterface())
        , m_physicalDevice              (context.getPhysicalDevice())
        , m_device                              (context.getDevice())
@@ -4631,7 +4631,8 @@ OperationContext::OperationContext (Context& context, PipelineCacheData& pipelin
 }
 
 OperationContext::OperationContext (Context& context, PipelineCacheData& pipelineCacheData, const DeviceInterface& vk, const VkDevice device, vk::Allocator& allocator)
-       : m_vki                                 (context.getInstanceInterface())
+       : m_context                             (context)
+       , m_vki                                 (context.getInstanceInterface())
        , m_vk                                  (vk)
        , m_physicalDevice              (context.getPhysicalDevice())
        , m_device                              (device)
@@ -4643,7 +4644,7 @@ OperationContext::OperationContext (Context& context, PipelineCacheData& pipelin
 {
 }
 
-OperationContext::OperationContext (const deUint32                                     apiVersion,
+OperationContext::OperationContext (Context&                                           context,
                                                                        const vk::InstanceInterface&    vki,
                                                                        const vk::DeviceInterface&              vkd,
                                                                        vk::VkPhysicalDevice                    physicalDevice,
@@ -4652,7 +4653,8 @@ OperationContext::OperationContext (const deUint32                                        apiVersion,
                                                                        const std::vector<std::string>& deviceExtensions,
                                                                        vk::BinaryCollection&                   programCollection,
                                                                        PipelineCacheData&                              pipelineCacheData)
-       : m_vki                                 (vki)
+       : m_context                             (context)
+       , m_vki                                 (vki)
        , m_vk                                  (vkd)
        , m_physicalDevice              (physicalDevice)
        , m_device                              (device)
@@ -4660,7 +4662,7 @@ OperationContext::OperationContext (const deUint32                                        apiVersion,
        , m_progCollection              (programCollection)
        , m_pipelineCacheData   (pipelineCacheData)
        , m_deviceExtensions    (deviceExtensions)
-       , m_usedApiVersion              (apiVersion)
+       , m_usedApiVersion              (context.getUsedApiVersion())
 {
 }
 
index ef312620a6c79faf44a28bdf33496392d71a89b2..7b9db4de63feff62c2099c2c6af0326d8dc5df30 100644 (file)
@@ -138,7 +138,7 @@ public:
                                                                                                                         const vk::VkDevice                     device,
                                                                                                                         vk::Allocator&                         allocator);
 
-                                                                       OperationContext                (const deUint32                                         apiVersion,
+                                                                       OperationContext                (Context&                                                       context,
                                                                                                                         const vk::InstanceInterface&           vki,
                                                                                                                         const vk::DeviceInterface&                     vkd,
                                                                                                                         vk::VkPhysicalDevice                           physicalDevice,
@@ -158,8 +158,13 @@ public:
        const std::vector<std::string>& getDeviceExtensions             (void) const { return m_deviceExtensions;}
        deUint32                                                getUsedApiVersion               (void) const { return m_usedApiVersion; }
 
+       bool isDeviceFunctionalitySupported(const std::string& extension) const
+       {
+               return m_context.isDeviceFunctionalitySupported(extension);
+       }
 
 private:
+       const vkt::Context&                             m_context;
        const vk::InstanceInterface&    m_vki;
        const vk::DeviceInterface&              m_vk;
        const vk::VkPhysicalDevice              m_physicalDevice;
index fcdb9a29e842131e5a29294ce0f7a7a60f94db84..22eb3a841937cd1d7daf94f489ee7ae4e767aea1 100644 (file)
@@ -1645,7 +1645,7 @@ tcu::TestStatus Win32KeyedMutexTestInstance::iterate (void)
                const vk::Unique<vk::VkCommandBuffer>   commandBufferRead       (allocateCommandBuffer(m_vkd, *m_device, *commandPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
                vk::SimpleAllocator                                             allocator                       (m_vkd, *m_device, vk::getPhysicalDeviceMemoryProperties(m_vki, m_physicalDevice));
                const std::vector<std::string>                  deviceExtensions;
-               OperationContext                                                operationContext        (m_context.getUsedApiVersion(), m_vki, m_vkd, m_physicalDevice, *m_device, allocator, deviceExtensions, m_context.getBinaryCollection(), m_pipelineCacheData);
+               OperationContext                                                operationContext        (m_context, m_vki, m_vkd, m_physicalDevice, *m_device, allocator, deviceExtensions, m_context.getBinaryCollection(), m_pipelineCacheData);
 
                if (!checkQueueFlags(m_queueFamilies[m_queueNdx].queueFlags, vk::VK_QUEUE_GRAPHICS_BIT))
                        TCU_THROW(NotSupportedError, "Operation not supported by the source queue");
index f1d81b038822df1a13b9b13156677bdbfc1e20b3..452172ea288f6124be6dc1046f6b873caf9b65af 100644 (file)
@@ -404,7 +404,7 @@ WindingTestInstance::WindingTestInstance (Context&                                  context,
 
 void WindingTestInstance::requireExtension (const char* name) const
 {
-       if(!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), name))
+       if(!m_context.isDeviceFunctionalitySupported(name))
                TCU_THROW(NotSupportedError, (std::string(name) + " is not supported").c_str());
 }
 
index 8bef451a8db99dfb1b4bfff8a5d6caec86b8caf5..8e291ae3ad4c7d72ecf647177f35bf83d64ea2b4 100644 (file)
@@ -385,7 +385,7 @@ protected:
 
 TransformFeedbackTestInstance::TransformFeedbackTestInstance (Context& context, const TestParameters& parameters)
        : TestInstance          (context)
-       , m_extensions          (context.requireDeviceExtension("VK_EXT_transform_feedback"))
+       , m_extensions          (context.requireDeviceFunctionality("VK_EXT_transform_feedback"))
        , m_imageExtent2D       (makeExtent2D(IMAGE_SIZE, IMAGE_SIZE))
        , m_parameters          (parameters)
        , m_rnd                         (0)
@@ -1468,7 +1468,7 @@ TransformFeedbackQueryTestInstance::TransformFeedbackQueryTestInstance (Context&
        if (m_parameters.testType == TEST_TYPE_QUERY_RESET)
        {
                // Check VK_EXT_host_query_reset is supported
-               m_context.requireDeviceExtension("VK_EXT_host_query_reset");
+               m_context.requireDeviceFunctionality("VK_EXT_host_query_reset");
                if(m_context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
                        throw tcu::NotSupportedError(std::string("Implementation doesn't support resetting queries from the host").c_str());
        }
index ef13a9195265fedf127212b148534c9444237c12..5d44b8ee28cabeac39cfd67aa979b594738e636a 100644 (file)
@@ -228,7 +228,7 @@ CustomInstance createCustomInstanceWithExtensions (Context& context, const std::
 
        for (const auto& ext : extensions)
        {
-               if (!vk::isInstanceExtensionSupported(apiVersion, availableExtensions, vk::RequiredExtension(ext)))
+               if (!context.isInstanceFunctionalitySupported(ext))
                        TCU_THROW(NotSupportedError, ext + " is not supported");
 
                if (!vk::isCoreInstanceExtension(apiVersion, ext))
index 30db1a92739e8093e0a355c61a814b0d7444e669..aa0009c0a407f2ac7ab5d531ea4f43b3a85c4cd0 100644 (file)
@@ -409,6 +409,25 @@ deUint32                                                           Context::getDeviceVersion                                       (void) const { return m_device->ge
 const vk::VkPhysicalDeviceFeatures&            Context::getDeviceFeatures                                      (void) const { return m_device->getDeviceFeatures();                                    }
 const vk::VkPhysicalDeviceFeatures2&   Context::getDeviceFeatures2                                     (void) const { return m_device->getDeviceFeatures2();                                   }
 
+bool Context::isDeviceFunctionalitySupported (const std::string& extension) const
+{
+       // check if extension was promoted to core
+       if (isCoreDeviceExtension(getUsedApiVersion(), extension))
+               return true;
+
+       // check if extension is on the lits of extensions for current device
+       const auto& extensions = getDeviceExtensions();
+       return de::contains(extensions.begin(), extensions.end(), extension);
+}
+
+bool Context::isInstanceFunctionalitySupported(const std::string& extension) const
+{
+       // NOTE: current implementation uses isInstanceExtensionSupported but
+       // this will change when some instance extensions will be promoted to the
+       // core; don't use isInstanceExtensionSupported directly, use this method instead
+       return isInstanceExtensionSupported(getUsedApiVersion(), getInstanceExtensions(), extension);
+}
+
 #include "vkDeviceFeaturesForContextDefs.inl"
 
 const vk::VkPhysicalDeviceProperties&  Context::getDeviceProperties                            (void) const { return m_device->getDeviceProperties();                                  }
@@ -428,17 +447,17 @@ bool                                                                      Context::contextSupports                                        (const ApiVersion version) const
 bool                                                                   Context::contextSupports                                        (const deUint32 requiredApiVersionBits) const
                                                                                                                                                                                                { return m_device->getUsedApiVersion() >= requiredApiVersionBits; }
 
-bool Context::requireDeviceExtension (const std::string& required)
+bool Context::requireDeviceFunctionality (const std::string& required)
 {
-       if (!isDeviceExtensionSupported(getUsedApiVersion(), getDeviceExtensions(), required))
+       if (!isDeviceFunctionalitySupported(required))
                TCU_THROW(NotSupportedError, required + " is not supported");
 
        return true;
 }
 
-bool Context::requireInstanceExtension (const std::string& required)
+bool Context::requireInstanceFunctionality (const std::string& required)
 {
-       if (!isInstanceExtensionSupported(getUsedApiVersion(), getInstanceExtensions(), required))
+       if (!isInstanceFunctionalitySupported(required))
                TCU_THROW(NotSupportedError, required + " is not supported");
 
        return true;
index 0e55344f6b8ead1756c44be99d08cbf733e52ae5..b6635adfd6f7e52600efd090bf3f1f8bf27a5b3c 100644 (file)
@@ -75,6 +75,9 @@ public:
        const vk::VkPhysicalDeviceFeatures&                     getDeviceFeatures                                       (void) const;
        const vk::VkPhysicalDeviceFeatures2&            getDeviceFeatures2                                      (void) const;
 
+       bool                                                                            isInstanceFunctionalitySupported        (const std::string& extension) const;
+       bool                                                                            isDeviceFunctionalitySupported          (const std::string& extension) const;
+
 #include "vkDeviceFeaturesForContextDecl.inl"
 
        const vk::VkPhysicalDeviceProperties&           getDeviceProperties                                     (void) const;
@@ -90,8 +93,8 @@ public:
        bool                                                                            contextSupports                                         (const deUint32 majorNum, const deUint32 minorNum, const deUint32 patchNum) const;
        bool                                                                            contextSupports                                         (const vk::ApiVersion version) const;
        bool                                                                            contextSupports                                         (const deUint32 requiredApiVersionBits) const;
-       bool                                                                            requireDeviceExtension                          (const std::string& required);
-       bool                                                                            requireInstanceExtension                        (const std::string& required);
+       bool                                                                            requireDeviceFunctionality                      (const std::string& required);
+       bool                                                                            requireInstanceFunctionality            (const std::string& required);
        bool                                                                            requireDeviceCoreFeature                        (const DeviceCoreFeature requiredDeviceCoreFeature);
 
        void*                                                                           getInstanceProcAddr                                     ();
index 242ff797595a0df004735c5936019620161e284c..78e074b2f5a5511ab07d3b7c2c4f76485234dea2 100644 (file)
@@ -364,7 +364,7 @@ bool TestCaseExecutor::spirvVersionSupported (vk::SpirvVersion spirvVersion)
                return true;
 
        if (spirvVersion <= vk::SPIRV_VERSION_1_4)
-               return vk::isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_spirv_1_4");
+               return m_context.isDeviceFunctionalitySupported("VK_KHR_spirv_1_4");
 
        return false;
 }
index c5fe1669973680696e50c6662c25ec389d540fe0..cbcaf766aacffaa5bb526e864080d6887f79f354 100644 (file)
@@ -171,7 +171,6 @@ struct CheckPhysicalDeviceSurfacePresentModesIncompleteResult : public CheckInco
 typedef vector<VkExtensionProperties> Extensions;
 
 CustomInstance createInstanceWithWsi (Context&                                         context,
-                                                                         const Extensions&                             supportedExtensions,
                                                                          Type                                                  wsiType,
                                                                          const vector<string>                  extraExtensions,
                                                                          const VkAllocationCallbacks*  pAllocator      = DE_NULL)
@@ -188,7 +187,7 @@ CustomInstance createInstanceWithWsi (Context&                                              context,
                 extensionName != extensions.end();
                 ++extensionName)
        {
-               if (!isInstanceExtensionSupported(version, supportedExtensions, RequiredExtension(*extensionName)))
+               if (!context.isInstanceFunctionalitySupported(*extensionName))
                        TCU_THROW(NotSupportedError, (*extensionName + " is not supported").c_str());
 
                if (!isCoreInstanceExtension(version, *extensionName))
@@ -208,7 +207,6 @@ struct InstanceHelper
                : supportedExtensions   (enumerateInstanceExtensionProperties(context.getPlatformInterface(),
                                                                                                                                          DE_NULL))
                , instance                              (createInstanceWithWsi(context,
-                                                                                                          supportedExtensions,
                                                                                                           wsiType,
                                                                                                           vector<string>(),
                                                                                                           pAllocator))
@@ -219,7 +217,6 @@ struct InstanceHelper
                : supportedExtensions   (enumerateInstanceExtensionProperties(context.getPlatformInterface(),
                                                                                                                                          DE_NULL))
                , instance                              (createInstanceWithWsi(context,
-                                                                                                          supportedExtensions,
                                                                                                           wsiType,
                                                                                                           extensions,
                                                                                                           pAllocator))
index 332ecfbe4c0cfa70cbec2c3c083cf34167a9bc90..34eb45f18c45ac82592b6e8f59c252c308d660fb 100644 (file)
@@ -1436,10 +1436,8 @@ public:
                DE_UNREF(deviceMask);   // needed for compatibility with acquireNextImage2KHR
        }
 
-       bool featureAvailable(const deUint32 deviceVersion, const Extensions& supportedExtensions)
+       bool featureAvailable(Context&)
        {
-               DE_UNREF(deviceVersion);
-               DE_UNREF(supportedExtensions);
                return true;                    // needed for compatibility with acquireNextImage2KHR
        }
 
@@ -1482,9 +1480,9 @@ public:
                m_info.deviceMask       = deviceMask;
        }
 
-       bool featureAvailable(const deUint32 deviceVersion, const Extensions& supportedExtensions)
+       bool featureAvailable(Context& context)
        {
-               return isDeviceExtensionSupported(deviceVersion, supportedExtensions, RequiredExtension("VK_KHR_device_group"));
+               return context.isDeviceFunctionalitySupported("VK_KHR_device_group");
        }
 
        VkResult call(VkSemaphore semaphore, VkFence fence, deUint32* imageIndex)
@@ -1520,7 +1518,7 @@ tcu::TestStatus basicRenderTest (Context& context, Type wsiType)
        const vector<VkImage>                   swapchainImages                         = getSwapchainImages(vkd, device, *swapchain);
 
        AcquireWrapperType acquireImageWrapper(vkd, device, 1u, *swapchain, std::numeric_limits<deUint64>::max());
-       if (!acquireImageWrapper.featureAvailable(context.getUsedApiVersion(), instHelper.supportedExtensions))
+       if (!acquireImageWrapper.featureAvailable(context))
                TCU_THROW(NotSupportedError, "Required extension is not supported");
 
        const TriangleRenderer                  renderer                                        (vkd,
index a744f7bf1a465d6f313dbe50641d2c9ec096df54..821f4eb17babecb5f6798474d3bac77169fef1bb 100644 (file)
@@ -577,7 +577,7 @@ void logTestCaseInfo (TestLog& log, const TestConfig& config)
 void checkSupport (Context& context, const TestConfig config)
 {
 #if !defined(FAKE_COLOR_CONVERSION)
-       if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_sampler_ycbcr_conversion"))
+       if (!context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion"))
                TCU_THROW(NotSupportedError, "Extension VK_KHR_sampler_ycbcr_conversion not supported");
 
        try
index a3a68f9d0b8e4010a3486d8c252a695148834190..3e8b885720801096e51cb44acd8fb310e3267722 100644 (file)
@@ -295,7 +295,7 @@ void checkSupport (Context& context, const TestParameters params)
 
        if (params.useArrayLayers)
        {
-               if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_ycbcr_image_arrays"))
+               if (!context.isDeviceFunctionalitySupported("VK_EXT_ycbcr_image_arrays"))
                        TCU_THROW(NotSupportedError, "VK_EXT_ycbcr_image_arrays is not supported");
 
                VkImageFormatProperties properties = getPhysicalDeviceImageFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(),
index 666f969b4162c16ed4aa10306c1d667689cfd6ff..1d901025571a44b7c1fca806b9316ab65db5f2ba 100644 (file)
@@ -213,10 +213,10 @@ void checkImageSupport (Context& context, VkFormat format, VkImageCreateFlags cr
                        reqExts.push_back("VK_KHR_get_memory_requirements2");
        }
 
-       for (vector<string>::const_iterator extIter = reqExts.begin(); extIter != reqExts.end(); ++extIter)
+       for (const string& ext : reqExts)
        {
-               if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), *extIter))
-                       TCU_THROW(NotSupportedError, (*extIter + " is not supported").c_str());
+               if (!context.isDeviceFunctionalitySupported(ext))
+                       TCU_THROW(NotSupportedError, (ext + " is not supported").c_str());
        }
 
        if (features.samplerYcbcrConversion == VK_FALSE)
index 95cc808f5d95a9b7a65faef45638c74afe847eac..fc6868dfea4b8e828db53b6c53020ff9e2bf560b 100644 (file)
@@ -1641,7 +1641,7 @@ def writeMandatoryFeatures(filename):
                                        dictStructs[m[0]].append(allRequirements[0])
 
        stream.extend(['bool checkMandatoryFeatures(const vkt::Context& context)\n{',
-                                  '\tif ( !vk::isInstanceExtensionSupported(context.getUsedApiVersion(), context.getInstanceExtensions(), "VK_KHR_get_physical_device_properties2") )',
+                                  '\tif ( !context.isInstanceFunctionalitySupported("VK_KHR_get_physical_device_properties2") )',
                                   '\t\tTCU_THROW(NotSupportedError, "Extension VK_KHR_get_physical_device_properties2 is not present");',
                                   '',
                                   '\tVkPhysicalDevice\t\t\t\t\tphysicalDevice\t\t= context.getPhysicalDevice();',