From: Marcin KaƄtoch Date: Tue, 26 Jul 2022 15:25:41 +0000 (+0200) Subject: Fix undefined behaviour by allowing NaNs X-Git-Tag: upstream/1.3.5~144^2~10^2~2^2^2~4^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b95b2a1da75ca3dc3a2cfac98ce10d9a699687e;p=platform%2Fupstream%2FVK-GL-CTS.git Fix undefined behaviour by allowing NaNs One graphicsfuzz test contains computations with the float constant 0x1.8p+128. This constant represents a NaN value. The computation with undef in the test allows any optimization/triggers undefined behavior and the driver is free to crash. Adding OpExecutionMode %4 SignedZeroInfNanPreserve 32 to the CTS fixes this by allowing NaNs. Affects: dEQP-VK.graphicsfuzz.cov-instruction-simplify-atanh-log-undefined Components: Vulkan VK-GL-CTS issue: 3787 Change-Id: Id7140deddec240fdc5d9b1712c974199fa06b250 --- diff --git a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-atanh-log-undefined.amber b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-atanh-log-undefined.amber index 52fe7d5..267b7ff 100644 --- a/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-atanh-log-undefined.amber +++ b/external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-instruction-simplify-atanh-log-undefined.amber @@ -56,6 +56,7 @@ SHADER vertex variant_vertex_shader PASSTHROUGH # _GLF_color.g = _float_0_0; # } # } +DEVICE_EXTENSION VK_KHR_shader_float_controls SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0 ; SPIR-V ; Version: 1.0 @@ -63,10 +64,13 @@ SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0 ; Bound: 57 ; Schema: 0 OpCapability Shader + OpCapability SignedZeroInfNanPreserve + OpExtension "SPV_KHR_float_controls" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %9 OpExecutionMode %4 OriginUpperLeft + OpExecutionMode %4 SignedZeroInfNanPreserve 32 OpSource ESSL 310 OpName %4 "main" OpName %9 "_GLF_color"