Cycles: Add a debug flag to disable QBVH
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 19 Jan 2016 17:38:41 +0000 (18:38 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 19 Jan 2016 17:38:41 +0000 (18:38 +0100)
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_python.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/util/util_debug.cpp
intern/cycles/util/util_debug.h

index c83da3d5b54e49509f0a1f047f8fdbba1b781a7b..d8084fa5014f4d33e23748cede8b6b321bec6c60 100644 (file)
@@ -554,6 +554,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
         cls.debug_use_cpu_sse41 = BoolProperty(name="SSE41", default=True)
         cls.debug_use_cpu_sse3 = BoolProperty(name="SSE3", default=True)
         cls.debug_use_cpu_sse2 = BoolProperty(name="SSE2", default=True)
+        cls.debug_use_qbvh = BoolProperty(name="QBVH", default=True)
 
         cls.debug_opencl_kernel_type = EnumProperty(
             name="OpenCL Kernel Type",
index 22df14201e838403c37f9fba335eac728dbeb116..522956d1590ca9121ba19de254f56a556112b628 100644 (file)
@@ -1511,12 +1511,13 @@ class CyclesRender_PT_debug(CyclesButtonsPanel, Panel):
         col = layout.column()
 
         col.label('CPU Flags:')
-        row = layout.row(align=True)
+        row = col.row(align=True)
         row.prop(cscene, "debug_use_cpu_sse2", toggle=True)
         row.prop(cscene, "debug_use_cpu_sse3", toggle=True)
         row.prop(cscene, "debug_use_cpu_sse41", toggle=True)
         row.prop(cscene, "debug_use_cpu_avx", toggle=True)
         row.prop(cscene, "debug_use_cpu_avx2", toggle=True)
+        col.prop(cscene, "debug_use_qbvh")
 
         col = layout.column()
         col.label('OpenCL Flags:')
index 006301eead74545c81f550637505002783057adb..4792f9612a9d57deab2db8d0eac524372e65822b 100644 (file)
@@ -65,6 +65,7 @@ bool debug_flags_sync_from_scene(BL::Scene b_scene)
        flags.cpu.sse41 = get_boolean(cscene, "debug_use_cpu_sse41");
        flags.cpu.sse3 = get_boolean(cscene, "debug_use_cpu_sse3");
        flags.cpu.sse2 = get_boolean(cscene, "debug_use_cpu_sse2");
+       flags.cpu.qbvh = get_boolean(cscene, "debug_use_qbvh");
        /* Synchronize OpenCL kernel type. */
        switch(get_enum(cscene, "debug_opencl_kernel_type")) {
                case 0:
index 8180aa0c94839e2b6ab6d4461c3ff30470614b60..78882156ed110712d2f01df1f03670790775c4e2 100644 (file)
@@ -442,7 +442,7 @@ SceneParams BlenderSync::get_scene_params(BL::Scene b_scene, bool background, bo
 
 #if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86)))
        if(is_cpu) {
-               params.use_qbvh = system_cpu_support_sse2();
+               params.use_qbvh = DebugFlags().cpu.qbvh && system_cpu_support_sse2();
        }
        else
 #endif
index df75d85e2c7d84714a25d91eace17c132f111d48..0f3862ad8696cdddfbdb14e100fc875730fa9fd6 100644 (file)
@@ -28,7 +28,8 @@ DebugFlags::CPU::CPU()
     avx(true),
     sse41(true),
     sse3(true),
-    sse2(true)
+    sse2(true),
+    qbvh(true)
 {
        reset();
 }
@@ -52,6 +53,8 @@ void DebugFlags::CPU::reset()
 
 #undef STRINGIFY
 #undef CHECK_CPU_FLAGS
+
+       qbvh = true;
 }
 
 DebugFlags::OpenCL::OpenCL()
index 53b1ea421649f94f0d02083eba43788548af9ea5..723d4a0a1ecc48437b9f9bacd537cd177d89ef20 100644 (file)
@@ -41,6 +41,9 @@ public:
                bool sse41;
                bool sse3;
                bool sse2;
+
+               /* Whether QBVH usage is allowed or not. */
+               bool qbvh;
        };
 
        /* Descriptor of OpenCL feature-set to be used. */