Don't run sparse texture tests if format isn't sparse supported
authorDave Airlie <airlied@redhat.com>
Thu, 21 Dec 2017 03:03:22 +0000 (13:03 +1000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 1 Mar 2018 16:51:09 +0000 (11:51 -0500)
These tests weren't checking if the format was support for sparse
operations, so add a check before executing the test.

Affects:
dEQP-VK.texture.shadow.*.sparse*

Components: Vulkan

VK-GL-CTS issue: 918

Change-Id: I5e55c2e4d8d1105df9d3ed8cbdf1b22e51b56b2a

external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp

index f508026..d1960e1 100644 (file)
@@ -350,6 +350,15 @@ void TextureBinding::updateTextureData (const TestTextureSp& textureData, const
        else
                VK_CHECK(imageFormatQueryResult);
 
+       if (sparse)
+       {
+               deUint32 numSparseImageProperties;
+               vk::VkSparseImageFormatProperties                                       sparseImageFormatProperties;
+               m_context.getInstanceInterface().getPhysicalDeviceSparseImageFormatProperties(m_context.getPhysicalDevice(), format, imageType, VK_SAMPLE_COUNT_1_BIT, imageUsageFlags, imageTiling, &numSparseImageProperties, &sparseImageFormatProperties);
+               if (numSparseImageProperties == 0)
+                       TCU_THROW(NotSupportedError, (std::string("Sparse format not supported: ") + vk::getFormatName(format)).c_str());
+       }
+
        if (imageFormatProperties.maxArrayLayers < arraySize)
                TCU_THROW(NotSupportedError, ("Maximum array layers number for this format is not enough for this test."));