[Bf-blender-cvs] [358191c] soc-2016-cycles_denoising: Cycles: Enable Flush-to-zero for denormals on Windows

Lukas Stockner noreply at git.blender.org
Tue Nov 22 04:25:49 CET 2016


Commit: 358191c9d70b09c0acdb3a9823eca1257ad7d2e7
Author: Lukas Stockner
Date:   Tue Nov 22 04:03:34 2016 +0100
Branches: soc-2016-cycles_denoising
https://developer.blender.org/rB358191c9d70b09c0acdb3a9823eca1257ad7d2e7

Cycles: Enable Flush-to-zero for denormals on Windows

===================================================================

M	intern/cycles/util/util_system.cpp
M	intern/cycles/util/util_system.h

===================================================================

diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp
index f859b9e..0ad9be6 100644
--- a/intern/cycles/util/util_system.cpp
+++ b/intern/cycles/util/util_system.cpp
@@ -282,6 +282,13 @@ bool system_cpu_support_avx2()
 
 #endif
 
+void system_enable_ftz()
+{
+#ifdef _MSC_VER
+	_controlfp(_DN_FLUSH, _MCW_DN);
+#endif
+}
+
 #ifdef WITH_CYCLES_DEBUG_FPE
 static void system_enable_fpe()
 {
diff --git a/intern/cycles/util/util_system.h b/intern/cycles/util/util_system.h
index a66c7eb..1a5b0f9 100644
--- a/intern/cycles/util/util_system.h
+++ b/intern/cycles/util/util_system.h
@@ -38,6 +38,8 @@ bool system_cpu_support_sse41();
 bool system_cpu_support_avx();
 bool system_cpu_support_avx2();
 
+void system_enable_ftz();
+
 #ifdef WITH_CYCLES_DEBUG_FPE
 typedef enum FPEState
 {




More information about the Bf-blender-cvs mailing list