Handle denorm flush to negative zero in unpackhalf2x16 tests.
authorJeff Bolz <jbolz@nvidia.com>
Fri, 31 Aug 2018 02:42:54 +0000 (21:42 -0500)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 6 Sep 2018 15:36:28 +0000 (11:36 -0400)
Whether input fp16 values are flushed to zero is implementation
dependent. However, negative denorm values can be flushed to negative
zero and the logic did not handle that case.

Affects: dEQP-VK.glsl.builtin.function.pack_unpack.unpackhalf2x16*
Component: Vulkan
VK-GL-CTS issue: 1341

Change-Id: I2cd4a68cb5e498cd714a7e55b27ae4bc05ccde2d

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

index 1d4dd8a..469369d 100644 (file)
@@ -856,7 +856,7 @@ private:
 
                if (conversion != CONVERTED && denorm)
                {
-                       if (resBits == 0)
+                       if (resBits == 0 || (ref < 0 && resBits == 0x80000000UL))
                        {
                                conversion = ZERO_FLUSHED;
                                return DE_TRUE;