Accept NaN as valid in atan2 precision tests
authorGraeme Leese <gleese@broadcom.com>
Fri, 27 Aug 2021 12:46:19 +0000 (13:46 +0100)
committerMohankumar Nekkarakalaya <mnekkara@qti.qualcomm.com>
Fri, 29 Oct 2021 00:17:25 +0000 (17:17 -0700)
The Vulkan CTS has been updated
(https://gerrit.khronos.org/c/vk-gl-cts/+/7857) so that it is not
required to generate correct results for atan(inf, inf), and this makes
the corresponding change in GL. The GLSL spec is not as clear on what is
required here, but does say:
    Built-in functions not listed above and not defined as equations of
    the above have undefined precision. These include, for example, the
    trigonometric functions

In general, I think that it is expected that the default state of Vulkan
is a match for GL.

Components: OpenGL
VK-GL-CTS issue: 3073
Affects: dEQP-GLES3.functional.shaders.builtin_functions.precision.atan2.highp_*

Change-Id: Ifae97a2e86962f5aff68d5eed09ba38069445468

modules/glshared/glsBuiltinPrecisionTests.cpp

index a46fc04..f59297c 100644 (file)
@@ -2486,7 +2486,7 @@ public:
                                ATan2                   (void) : CFloatFunc2 ("atan", deAtan2) {}
 
 protected:
-       Interval        innerExtrema    (const EvalContext&             ctx,
+       Interval        innerExtrema    (const EvalContext&,
                                                                 const Interval&                yi,
                                                                 const Interval&                xi) const
        {
@@ -2500,7 +2500,7 @@ protected:
                                ret |= Interval(-DE_PI_DOUBLE, DE_PI_DOUBLE);
                }
 
-               if (ctx.format.hasInf() != YES && (!yi.isFinite() || !xi.isFinite()))
+               if ((!yi.isFinite() || !xi.isFinite()))
                {
                        // Infinities may not be supported, allow anything, including NaN
                        ret |= TCU_NAN;