Simplify feature checking in YCbCr tests
authorGraeme Leese <gleese@broadcom.com>
Mon, 12 Sep 2022 09:24:51 +0000 (10:24 +0100)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 29 Sep 2022 16:53:29 +0000 (16:53 +0000)
Components: Vulkan
VK-GL-CTS Issue: 3937
Affects: dEQP-VK.ycbcr.*

Change-Id: I55fe0172efe4e64127927a10c08cc08d741ed817

external/vulkancts/modules/vulkan/ycbcr/vktYCbCrUtil.cpp

index 354a9fd..016de50 100644 (file)
@@ -191,25 +191,14 @@ void checkImageSupport (Context& context, VkFormat format, VkImageCreateFlags cr
 {
        const bool                                                                                                      disjoint        = (createFlags & VK_IMAGE_CREATE_DISJOINT_BIT) != 0;
        const VkPhysicalDeviceSamplerYcbcrConversionFeatures            features        = context.getSamplerYcbcrConversionFeatures();
-       vector<string>                                                                                          reqExts;
 
-       if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_sampler_ycbcr_conversion"))
-               reqExts.push_back("VK_KHR_sampler_ycbcr_conversion");
+       if (features.samplerYcbcrConversion == VK_FALSE)
+               TCU_THROW(NotSupportedError, "samplerYcbcrConversion is not supported");
 
        if (disjoint)
        {
-               if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_bind_memory2"))
-                       reqExts.push_back("VK_KHR_bind_memory2");
-               if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_get_memory_requirements2"))
-                       reqExts.push_back("VK_KHR_get_memory_requirements2");
-       }
-
-       for (const string& ext : reqExts)
-               context.requireDeviceFunctionality(ext);
-
-       if (features.samplerYcbcrConversion == VK_FALSE)
-       {
-               TCU_THROW(NotSupportedError, "samplerYcbcrConversion is not supported");
+               context.requireDeviceFunctionality("VK_KHR_bind_memory2");
+               context.requireDeviceFunctionality("VK_KHR_get_memory_requirements2");
        }
 
        {