Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2020-06-24 19:42:00 +0300
committerRay Molenkamp <github@lazydodo.com>2020-06-24 19:42:00 +0300
commit5cfbc722d095664c3d2496f21d9deb21c47f2e12 (patch)
treec2faceea65da47da56753690393f33a5802c2a50 /intern
parentc2ab069dfca3c2c82313d7f5d2fa2c0a97dbe514 (diff)
Fix T78047: Fix failing denoiser tests on windows
When we switched to MSVC2019 and C++17 we seemingly managed to trigger a code-gen bug with MSVC in the AVX code-path. This change works around the issue by (hopefully temporary) disabling the optimizer for the fast_exp2f4 function, given it is only used in a single pass of the denoiser and nowhere else, this is luckily not as bad as it could have been. Once the compiler is fixed or a different fix is available we'll have to revisit this. Details and link to the repro posted to MS is available in T78047
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/util/util_math_fast.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/intern/cycles/util/util_math_fast.h b/intern/cycles/util/util_math_fast.h
index dbed83ab84d..1e0792859a2 100644
--- a/intern/cycles/util/util_math_fast.h
+++ b/intern/cycles/util/util_math_fast.h
@@ -446,6 +446,11 @@ ccl_device_inline float fast_expf(float x)
}
#ifndef __KERNEL_GPU__
+/* MSVC seems to have a codegen bug here in atleast SSE41/AVX
+ * see T78047 for details. */
+#ifdef _MSC_VER
+# pragma optimize( "", off )
+#endif
ccl_device float4 fast_exp2f4(float4 x)
{
const float4 one = make_float4(1.0f);
@@ -461,6 +466,9 @@ ccl_device float4 fast_exp2f4(float4 x)
r = madd4(x, r, make_float4(1.0f));
return __int4_as_float4(__float4_as_int4(r) + (m << 23));
}
+#ifdef _MSC_VER
+# pragma optimize( "", on )
+#endif
ccl_device_inline float4 fast_expf4(float4 x)
{