Fix int64 robustness bugs
authorAndreas Flöjt <andreas.floejt@arm.com>
Thu, 5 May 2022 12:18:06 +0000 (14:18 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 2 Jun 2022 19:05:42 +0000 (19:05 +0000)
First bug: VkImage and VkImageView that use different formats without
specifying the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag on the image.

Second bug: Using a shader with a multisampled storage image without
checking the shaderStorageImageMultisample feature.

Affects:
dEQP-VK.robustness.image_robustness.*.r64i.*

Components: Vulkan

VK-GL-CTS issue: 3680

Change-Id: I7b984c3c7b6b2ee551618b7a32d4a841e942cd95

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

index d4b6dc2..14c3e16 100644 (file)
@@ -442,6 +442,11 @@ void RobustnessExtsTestCase::checkSupport(Context& context) const
        if (m_data.nullDescriptor && !robustness2Features.nullDescriptor)
                TCU_THROW(NotSupportedError, "nullDescriptor not supported");
 
+       // The fill shader for 64-bit multisample image tests uses a storage image.
+       if (m_data.samples > VK_SAMPLE_COUNT_1_BIT && formatIsR64(m_data.format) &&
+               !features2.features.shaderStorageImageMultisample)
+               TCU_THROW(NotSupportedError, "shaderStorageImageMultisample not supported");
+
        if ((m_data.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) &&
                m_data.samples != VK_SAMPLE_COUNT_1_BIT &&
                !features2.features.shaderStorageImageMultisample)
@@ -1755,9 +1760,13 @@ tcu::TestStatus RobustnessExtsTestInstance::iterate (void)
 
        vector<BufferViewHandleSp>                                      bufferViews(1);
 
-       VkImageCreateFlags imageCreateFlags = 0;
+       VkImageCreateFlags mutableFormatFlag = 0;
+       // The 64-bit image tests use a view format which differs from the image.
+       if (formatIsR64(m_data.format))
+               mutableFormatFlag = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
+       VkImageCreateFlags imageCreateFlags = mutableFormatFlag;
        if (m_data.viewType == VK_IMAGE_VIEW_TYPE_CUBE || m_data.viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY)
-               imageCreateFlags = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
+               imageCreateFlags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
 
        const bool featureSampledImage = ((getPhysicalDeviceFormatProperties(m_context.getInstanceInterface(),
                                                                                m_context.getPhysicalDevice(),
@@ -1770,7 +1779,7 @@ tcu::TestStatus RobustnessExtsTestInstance::iterate (void)
        {
                VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,    // VkStructureType                      sType;
                DE_NULL,                                                                // const void*                          pNext;
-               (VkImageCreateFlags)0u,                                 // VkImageCreateFlags           flags;
+               mutableFormatFlag,                                              // VkImageCreateFlags           flags;
                VK_IMAGE_TYPE_2D,                                               // VkImageType                          imageType;
                m_data.format,                                                  // VkFormat                                     format;
                {