Check for imageCubeArray feature in image tests
authorChris Forbes <chrisforbes@google.com>
Fri, 17 May 2019 15:48:42 +0000 (08:48 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 22 May 2019 06:37:36 +0000 (02:37 -0400)
Components: Vulkan
Affects: dEQP-VK.image.*cube_array*
VK-GL-CTS Issue: #1781

Change-Id: Idbf3e96481336820520a46293ca3eaf74b21654d

external/vulkancts/modules/vulkan/image/vktImageAtomicOperationTests.cpp
external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp
external/vulkancts/modules/vulkan/image/vktImageQualifiersTests.cpp
external/vulkancts/modules/vulkan/image/vktImageSizeTests.cpp

index 12ef6e1..f1f27ae 100644 (file)
@@ -419,6 +419,7 @@ public:
        virtual void                            commandsAfterCompute     (const VkCommandBuffer                 cmdBuffer) const = 0;
 
        virtual bool                            verifyResult                     (Allocation&                                   outputBufferAllocation) const = 0;
+       void                                            checkRequirements                (void) const;
 
 protected:
        const string                            m_name;
@@ -450,6 +451,14 @@ BinaryAtomicInstanceBase::BinaryAtomicInstanceBase (Context&                               context,
 {
 }
 
+void BinaryAtomicInstanceBase::checkRequirements (void) const
+{
+       if (m_imageType == IMAGE_TYPE_CUBE_ARRAY && !m_context.getDeviceFeatures().imageCubeArray)
+       {
+               TCU_THROW(NotSupportedError, "imageCubeArray feature not supported");
+       }
+}
+
 tcu::TestStatus        BinaryAtomicInstanceBase::iterate (void)
 {
        const VkDevice                  device                          = m_context.getDevice();
@@ -460,6 +469,8 @@ tcu::TestStatus     BinaryAtomicInstanceBase::iterate (void)
        const VkDeviceSize              imageSizeInBytes        = tcu::getPixelSize(m_format) * getNumPixels(m_imageType, m_imageSize);
        const VkDeviceSize              outBuffSizeInBytes      = getOutputBufferSize();
 
+       checkRequirements();
+
        const VkImageCreateInfo imageParams     =
        {
                VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,                                    // VkStructureType                      sType;
index 11c815b..3a77c51 100644 (file)
@@ -554,6 +554,9 @@ void StoreTestInstance::checkRequirements (void)
 
        if (!m_declareImageFormatInShader && !features.shaderStorageImageWriteWithoutFormat)
                throw tcu::NotSupportedError("shaderStorageImageWriteWithoutFormat feature not supported");
+
+    if (m_texture.type() == IMAGE_TYPE_CUBE_ARRAY && !features.imageCubeArray)
+        TCU_THROW(NotSupportedError, "imageCubeArray feature not supported");
 }
 
 //! Store test for images
@@ -960,6 +963,9 @@ void LoadStoreTestInstance::checkRequirements (void)
 
        if (!m_declareImageFormatInShader && !features.shaderStorageImageReadWithoutFormat)
                throw tcu::NotSupportedError("shaderStorageImageReadWithoutFormat feature not supported");
+
+    if (m_texture.type() == IMAGE_TYPE_CUBE_ARRAY && !features.imageCubeArray)
+        TCU_THROW(NotSupportedError, "imageCubeArray feature not supported");
 }
 
 
index e973689..8d1299d 100644 (file)
@@ -327,6 +327,8 @@ public:
 
        virtual void                                    commandsAfterCompute                    (const VkCommandBuffer          cmdBuffer,
                                                                                                                                         const VkDeviceSize                     bufferSizeInBytes) const = 0;
+
+       virtual void                                    checkRequirements                               (void) const;
 protected:
 
        tcu::TextureLevel                               generateReferenceImage                  (void) const;
@@ -355,6 +357,14 @@ MemoryQualifierInstanceBase::MemoryQualifierInstanceBase (Context&                                 context,
 {
 }
 
+void MemoryQualifierInstanceBase::checkRequirements (void) const
+{
+       if (m_imageType == IMAGE_TYPE_CUBE_ARRAY && !m_context.getDeviceFeatures().imageCubeArray)
+       {
+               TCU_THROW(NotSupportedError, "imageCubeArray feature not supported");
+       }
+}
+
 tcu::TestStatus        MemoryQualifierInstanceBase::iterate (void)
 {
        const VkDevice                  device                          = m_context.getDevice();
@@ -364,6 +374,8 @@ tcu::TestStatus     MemoryQualifierInstanceBase::iterate (void)
 
        const VkDeviceSize      bufferSizeInBytes = getNumPixels(m_imageType, m_imageSize) * tcu::getPixelSize(m_format);
 
+       checkRequirements();
+
        // Prepare resources for the test
        prepareResources(bufferSizeInBytes);
 
index c9ce151..13411b3 100644 (file)
@@ -250,6 +250,7 @@ public:
                                                                                                                                 const VkFormat                 format);
 
        tcu::TestStatus                 iterate                                         (void);
+       void                                                    checkRequirements                       (void) const;
 
        virtual                                                 ~SizeTestInstance                       (void) {}
 
@@ -282,6 +283,14 @@ SizeTestInstance::SizeTestInstance (Context& context, const Texture& texture, co
                MemoryRequirement::HostVisible));
 }
 
+void SizeTestInstance::checkRequirements (void) const
+{
+       if (m_texture.type() == IMAGE_TYPE_CUBE_ARRAY && !m_context.getDeviceFeatures().imageCubeArray)
+       {
+               TCU_THROW(NotSupportedError, "imageCubeArray feature not supported");
+       }
+}
+
 tcu::TestStatus SizeTestInstance::iterate (void)
 {
        const DeviceInterface&  vk                                      = m_context.getDeviceInterface();
@@ -289,6 +298,8 @@ tcu::TestStatus SizeTestInstance::iterate (void)
        const VkQueue                   queue                           = m_context.getUniversalQueue();
        const deUint32                  queueFamilyIndex        = m_context.getUniversalQueueFamilyIndex();
 
+       checkRequirements();
+
        // Create memory barriers.
 
        const VkBufferMemoryBarrier shaderWriteBarrier = makeBufferMemoryBarrier(