Fix more 16bit denorms in precision tests
authorGraeme Leese <gleese@broadcom.com>
Thu, 27 Jun 2019 10:31:36 +0000 (11:31 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 5 Jul 2019 07:29:11 +0000 (03:29 -0400)
The denorm code that was fixed in: https://gerrit.khronos.org/#/c/4135/
still persisted in a different function that I hadn't noticed. Update it
there as well.

Because this function is being called on fixed floats, rather than on
random ones, I don't think the brokenness of the old code will cause a
practical problem, but the new version is simpler and more correct, so
I've changed it anyway.

Components: Vulkan
VK-GL-CTS issue: 1843
Affects: dEQP-VK.glsl.builtin.precision_fp16_storage32b.*

Change-Id: I6d6d7f8678f6edf41255e194650648c865b71e76

external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp

index f2a7b1c..4fee160 100644 (file)
@@ -5243,7 +5243,7 @@ void DefaultSampling<float>::removeNotInRange (vector<float>& dst, const Interva
 {
        for (vector<float>::iterator it = dst.begin(); it < dst.end();)
        {
-               if ( !inputRange.contains(static_cast<double>(*it)) || (glu::PRECISION_LAST == prec && (1.0 - deAbs(static_cast<double>(*it)) >= 0.999939)))
+               if ( !inputRange.contains(static_cast<double>(*it)) || (prec == glu::PRECISION_LAST && isDenorm16(deFloat32To16Round(*it, DE_ROUNDINGMODE_TO_ZERO))))
                        it = dst.erase(it);
                else
                        ++it;