Relax threshold in cube map filtering tests
authorYanjun Zhang <Yanjun.Zhang@verisilicon.com>
Fri, 7 Jul 2017 20:45:59 +0000 (13:45 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Sun, 16 Jul 2017 12:52:10 +0000 (08:52 -0400)
Use the same colorThreshold calculation as GLES CTS so Vulkan CTS
has the same behavior as GLES CTS.

Components: Vulkan

Affects:
dEQP-VK.pipeline.sampler.view_type.cube.format.r5g6b5_unorm_pack16.*

VK-GL-CTS issue: 561

Change-Id: I9bd632bb242f653b1f2d8bb50ee9867da926e95b

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

index 84ce8d7..bf162cd 100644 (file)
@@ -1454,6 +1454,7 @@ tcu::TestStatus ImageSamplingInstance::verifyImage (void)
 
                const bool                                                      allowSnorm8Bug  = m_texture->getTextureFormat().type == tcu::TextureFormat::SNORM_INT8 &&
                                                                                                                          (m_samplerParams.minFilter == VK_FILTER_LINEAR || m_samplerParams.magFilter == VK_FILTER_LINEAR);
+               const bool                                                      isNearestOnly   = (m_samplerParams.minFilter == VK_FILTER_NEAREST && m_samplerParams.magFilter == VK_FILTER_NEAREST);
 
                tcu::LookupPrecision                            lookupPrecision;
 
@@ -1462,7 +1463,7 @@ tcu::TestStatus ImageSamplingInstance::verifyImage (void)
                lookupPrecision.coordBits               = tcu::IVec3(17, 17, 17);
                lookupPrecision.uvwBits                 = tcu::IVec3(5, 5, 5);
                lookupPrecision.colorMask               = tcu::BVec4(true);
-               lookupPrecision.colorThreshold  = tcu::computeFixedPointThreshold(tcu::IVec4(8, 8, 8, 8)) / swizzleScaleBias(lookupScale, m_componentMapping);
+               lookupPrecision.colorThreshold  = tcu::computeFixedPointThreshold(max((tcu::IVec4(8, 8, 8, 8) - (isNearestOnly ? 1 : 2)), tcu::IVec4(0))) / swizzleScaleBias(lookupScale, m_componentMapping);
 
                if (tcu::isSRGB(m_texture->getTextureFormat()))
                        lookupPrecision.colorThreshold += tcu::Vec4(4.f / 255.f);