Fix check support for (Sign|Zero)Extend tests
authorPiotr Byszewski <piotr.byszewski@mobica.com>
Mon, 2 Sep 2019 10:59:03 +0000 (12:59 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 10 Oct 2019 13:29:28 +0000 (09:29 -0400)
Components: Vulkan

Affects:
dEQP-VK.image.extend_operands_spirv1p4.*

Change-Id: I5c546afcfdc533957fbb7d78a0a98f8845a56a1b
(cherry picked from commit aa2226758650dee8239d0b36035c41b65ec1382d)

external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp

index 6cdc82d..12e9799 100644 (file)
@@ -1508,7 +1508,6 @@ public:
 
 protected:
 
-       void                                                    checkRequirements(void);
        VkDescriptorSetLayout                   prepareDescriptors                                              (void);
        void                                                    commandBeforeCompute                                    (const VkCommandBuffer  cmdBuffer);
        void                                                    commandBetweenShaderInvocations                 (const VkCommandBuffer  cmdBuffer);
@@ -1545,7 +1544,7 @@ ImageExtendOperandTestInstance::ImageExtendOperandTestInstance (Context& context
                                                                                                                                const Texture& texture,
                                                                                                                                const VkFormat format,
                                                                                                                                const bool signExtend)
-       : BaseTestInstance              (context, texture, format, true, true)
+       : BaseTestInstance              (context, texture, format, true, true, false, false)
        , m_signExtend                  (signExtend)
 {
        const DeviceInterface&          vk                              = m_context.getDeviceInterface();
@@ -1592,22 +1591,6 @@ ImageExtendOperandTestInstance::ImageExtendOperandTestInstance (Context& context
        flushAlloc(vk, device, alloc);
 }
 
-void ImageExtendOperandTestInstance::checkRequirements (void)
-{
-       const vk::VkFormatProperties    formatProperties        (vk::getPhysicalDeviceFormatProperties(m_context.getInstanceInterface(),
-                                                                                                                                                                                          m_context.getPhysicalDevice(),
-                                                                                                                                                                                          m_format));
-
-       if (m_context.requireDeviceExtension("VK_KHR_spirv_1_4"))
-               TCU_THROW(NotSupportedError, "VK_KHR_spirv_1_4 not supported");
-
-       if ((m_texture.type() != IMAGE_TYPE_BUFFER) && !(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT))
-               TCU_THROW(NotSupportedError, "Format not supported for storage images");
-
-       if (m_texture.type() == IMAGE_TYPE_BUFFER && !(formatProperties.bufferFeatures & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT))
-               TCU_THROW(NotSupportedError, "Format not supported for storage texel buffers");
-}
-
 VkDescriptorSetLayout ImageExtendOperandTestInstance::prepareDescriptors (void)
 {
        const DeviceInterface&  vk              = m_context.getDeviceInterface();
@@ -1737,6 +1720,7 @@ public:
                                                                                                         const VkFormat                                         format,
                                                                                                         const bool                                                     readSigned);
 
+       void                                    checkSupport                    (Context&                               context) const;
        void                                    initPrograms                    (SourceCollections&             programCollection) const;
        TestInstance*                   createInstance                  (Context&                               context) const;
 
@@ -1758,6 +1742,22 @@ ImageExtendOperandTest::ImageExtendOperandTest (tcu::TestContext&                                testCtx,
 {
 }
 
+void ImageExtendOperandTest::checkSupport (Context& context) const
+{
+       const vk::VkFormatProperties    formatProperties        (vk::getPhysicalDeviceFormatProperties(context.getInstanceInterface(),
+                                                                                                                                                                                          context.getPhysicalDevice(),
+                                                                                                                                                                                          m_format));
+
+       if (!context.requireDeviceExtension("VK_KHR_spirv_1_4"))
+               TCU_THROW(NotSupportedError, "VK_KHR_spirv_1_4 not supported");
+
+       if ((m_texture.type() != IMAGE_TYPE_BUFFER) && !(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT))
+               TCU_THROW(NotSupportedError, "Format not supported for storage images");
+
+       if (m_texture.type() == IMAGE_TYPE_BUFFER && !(formatProperties.bufferFeatures & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT))
+               TCU_THROW(NotSupportedError, "Format not supported for storage texel buffers");
+}
+
 void ImageExtendOperandTest::initPrograms (SourceCollections& programCollection) const
 {
        tcu::StringTemplate shaderTemplate(