Change RobustnessExt tests to use format_features2
authorGraeme Leese <gleese@broadcom.com>
Wed, 14 Jul 2021 13:45:17 +0000 (14:45 +0100)
committerPeter Kohaut <peter.kohaut@gmail.com>
Sun, 5 Sep 2021 22:10:15 +0000 (00:10 +0200)
The no_fmt_qual variants of these tests can run on any format that
exposes the feature flag. This means that we get somewhat more coverage
on implementations that don't support both reading and writing without
format qualifiers.

Components: Vulkan
Affects: dEQP-VK.robustness.robustness2.*
         dEQP-VK.robustness.image_robustness.*

Change-Id: I8564fcd9d1c4eefc28239657b61536a0b8ecdfb5

external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp

index 26edc11..24781b3 100644 (file)
@@ -453,9 +453,14 @@ void RobustnessExtsTestCase::checkSupport(Context& context) const
                TCU_THROW(NotSupportedError, "Vulkan 1.1 not supported");
 
        if ((m_data.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER || m_data.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) &&
-               !m_data.formatQualifier &&
-               (!features2.features.shaderStorageImageReadWithoutFormat || !features2.features.shaderStorageImageWriteWithoutFormat))
-               TCU_THROW(NotSupportedError, "shaderStorageImageReadWithoutFormat or shaderStorageImageWriteWithoutFormat not supported");
+               !m_data.formatQualifier)
+       {
+               const VkFormatPropertiesExtendedKHR formatProperties = context.getFormatProperties(m_data.format);
+               if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR))
+                       TCU_THROW(NotSupportedError, "Format does not support reading without format");
+               if (!(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR))
+                       TCU_THROW(NotSupportedError, "Format does not support writing without format");
+       }
 
        if (m_data.pushDescriptor)
                context.requireDeviceFunctionality("VK_KHR_push_descriptor");