Use larger threshold for EAC formats in sampler tests
authorzeppelin <zeppelin@vivantecorp.com>
Fri, 1 Apr 2016 01:43:50 +0000 (18:43 -0700)
committerPyry Haulos <phaulos@google.com>
Thu, 7 Apr 2016 20:22:07 +0000 (13:22 -0700)
Fixes #350

external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.hpp

index b135d4d..2546fe2 100644 (file)
@@ -347,6 +347,7 @@ ImageSamplingInstance::ImageSamplingInstance (Context&                                                      context,
                                                                                          const std::vector<Vertex4Tex4>&       vertices)
        : vkt::TestInstance             (context)
        , m_imageViewType               (imageViewType)
+       , m_imageFormat                 (imageFormat)
        , m_imageSize                   (imageSize)
        , m_layerCount                  (layerCount)
        , m_componentMapping    (componentMapping)
@@ -995,16 +996,20 @@ tcu::TestStatus ImageSamplingInstance::verifyImage (void)
                const deUint32                          queueFamilyIndex                        = m_context.getUniversalQueueFamilyIndex();
                SimpleAllocator                         memAlloc                                        (vk, vkDevice, getPhysicalDeviceMemoryProperties(m_context.getInstanceInterface(), m_context.getPhysicalDevice()));
                MovePtr<tcu::TextureLevel>      result                                          = readColorAttachment(vk, vkDevice, queue, queueFamilyIndex, memAlloc, *m_colorImage, m_colorFormat, m_renderSize);
+               tcu::UVec4                                      threshold                                       = tcu::UVec4(4, 4, 4, 4);
+
+               if ((m_imageFormat == vk::VK_FORMAT_EAC_R11G11_SNORM_BLOCK) || (m_imageFormat == vk::VK_FORMAT_EAC_R11_SNORM_BLOCK))
+                       threshold = tcu::UVec4(8, 8, 8, 8);
 
                compareOk = tcu::intThresholdPositionDeviationCompare(m_context.getTestContext().getLog(),
-                                                                                                                         "IntImageCompare",
-                                                                                                                         "Image comparison",
-                                                                                                                         refRenderer->getAccess(),
-                                                                                                                         result->getAccess(),
-                                                                                                                         tcu::UVec4(4, 4, 4, 4),
-                                                                                                                         tcu::IVec3(1, 1, 0),
-                                                                                                                         true,
-                                                                                                                         tcu::COMPARE_LOG_RESULT);
+                                                                     "IntImageCompare",
+                                                                     "Image comparison",
+                                                                     refRenderer->getAccess(),
+                                                                     result->getAccess(),
+                                                                     threshold,
+                                                                     tcu::IVec3(1, 1, 0),
+                                                                     true,
+                                                                     tcu::COMPARE_LOG_RESULT);
        }
 
        if (compareOk)
index 57e9a9e..3aebcae 100644 (file)
@@ -69,6 +69,7 @@ protected:
 
 private:
        const vk::VkImageViewType                                       m_imageViewType;
+       const vk::VkFormat                                                      m_imageFormat;
        const tcu::IVec3                                                        m_imageSize;
        const int                                                                       m_layerCount;