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 @@
# _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 @@
; 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"