Add missing feature check to MS copy tests
authorIlkka Saarelainen <ilkka.saarelainen@siru.fi>
Thu, 18 Nov 2021 06:31:30 +0000 (08:31 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Fri, 3 Dec 2021 05:03:22 +0000 (05:03 +0000)
Some of the multisample copy and resolve tests require fragmentStoresAndAtomics
feature, but the feature is not checked in "checkSupport" function.

This CL adds the feature check for those tests.

Affects:
dEQP-VK.api.copy_and_blit.*.resolve_image.*

Components: Vulkan

VK-GL-CTS issue: 3317

Change-Id: I7dba8b9f1e8090416a00ade6cd4e0acaf9e43e68

external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp

index 89a1af921a1821db279f4f0d0691e5551b2ea993..5013bb2c785b039e52d0e3fff3a408d516a1a3ce 100644 (file)
@@ -5406,14 +5406,18 @@ enum ResolveImageToImageOptions{NO_OPTIONAL_OPERATION,
 class ResolveImageToImage : public CopiesAndBlittingTestInstance
 {
 public:
-                                                                                               ResolveImageToImage                     (Context&                                                       context,
-                                                                                                                                                        TestParams                                                     params,
-                                                                                                                                                        const ResolveImageToImageOptions       options);
-       virtual tcu::TestStatus                                         iterate                                         (void);
+                                                                                               ResolveImageToImage                             (Context&                                                       context,
+                                                                                                                                                                TestParams                                                     params,
+                                                                                                                                                                const ResolveImageToImageOptions       options);
+       virtual tcu::TestStatus                                         iterate                                                 (void);
+       static inline bool                                                      shouldVerifyIntermediateResults (ResolveImageToImageOptions option)
+       {
+               return option == COPY_MS_IMAGE_TO_MS_IMAGE || option == COPY_MS_IMAGE_TO_ARRAY_MS_IMAGE || option == COPY_MS_IMAGE_LAYER_TO_MS_IMAGE;
+       }
 protected:
-       virtual tcu::TestStatus                                         checkTestResult                         (tcu::ConstPixelBufferAccess result = tcu::ConstPixelBufferAccess());
-       void                                                                            copyMSImageToMSImage            (deUint32 copyArraySize);
-       tcu::TestStatus                                                         checkIntermediateCopy           (void);
+       virtual tcu::TestStatus                                         checkTestResult                                 (tcu::ConstPixelBufferAccess result);
+       void                                                                            copyMSImageToMSImage                    (deUint32 copyArraySize);
+       tcu::TestStatus                                                         checkIntermediateCopy                   (void);
 private:
        Move<VkImage>                                                           m_multisampledImage;
        de::MovePtr<Allocation>                                         m_multisampledImageAlloc;
@@ -6050,7 +6054,7 @@ tcu::TestStatus ResolveImageToImage::iterate (void)
 
        de::MovePtr<tcu::TextureLevel>  resultTextureLevel      = readImage(*m_destination, m_params.dst.image);
 
-       if (m_options == COPY_MS_IMAGE_TO_MS_IMAGE || m_options == COPY_MS_IMAGE_TO_ARRAY_MS_IMAGE || m_options == COPY_MS_IMAGE_LAYER_TO_MS_IMAGE)
+       if (shouldVerifyIntermediateResults(m_options))
        {
                // Verify the intermediate multisample copy operation happens properly instead of, for example, shuffling samples around or
                // resolving the image and giving every sample the same value.
@@ -6744,6 +6748,12 @@ public:
        {
                const VkSampleCountFlagBits     rasterizationSamples = m_params.samples;
 
+               // Intermediate result check uses fragmentStoresAndAtomics.
+               if (ResolveImageToImage::shouldVerifyIntermediateResults(m_options) && !context.getDeviceFeatures().fragmentStoresAndAtomics)
+               {
+                       TCU_THROW(NotSupportedError, "fragmentStoresAndAtomics not supported");
+               }
+
                if (!(context.getDeviceProperties().limits.framebufferColorSampleCounts & rasterizationSamples))
                        throw tcu::NotSupportedError("Unsupported number of rasterization samples");