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 <LazyDodo>2020-02-14 15:54:09 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2020-02-14 15:55:11 +0300
commit9339dc6dd1080730d1cf0e9a3f14d6139b2fda06 (patch)
treeec6e99efcc796adacecdc47febbed30abf066637 /intern
parent1c1b78eab584e9c4ccdd60568af94d6ec5ef999c (diff)
Fix T70685: Cycles crash using WITH_CYCLES_NATIVE_ONLY on Windows
MSVC does not have -march=native, so the kernel gets built without AVX2 and BVH8 support. The code assumed it to be available and crashed Differential Revision: https://developer.blender.org/D6082
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/device/device_cpu.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index 42ebf3a8399..795781ee072 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -338,7 +338,10 @@ class CPUDevice : public Device {
if (DebugFlags().cpu.has_sse2() && system_cpu_support_sse2()) {
bvh_layout_mask |= BVH_LAYOUT_BVH4;
}
-#if defined(__x86_64__) || defined(_M_X64)
+ /* MSVC does not support the -march=native switch and you always end up */
+ /* with an sse2 kernel when you use WITH_KERNEL_NATIVE. We *cannot* feed */
+ /* that kernel BVH8 even if the CPU flags would allow for it. */
+#if (defined(__x86_64__) || defined(_M_X64)) && !(defined(_MSC_VER) && defined(WITH_KERNEL_NATIVE))
if (DebugFlags().cpu.has_avx2() && system_cpu_support_avx2()) {
bvh_layout_mask |= BVH_LAYOUT_BVH8;
}