[Bf-blender-cvs] [99436acde8f] master: Cycles: enable Embree by default for CPU rendering

Brecht Van Lommel noreply at git.blender.org
Mon Jun 22 13:28:16 CEST 2020


Commit: 99436acde8fbb7381f095922bb61455b0c8fb9a9
Author: Brecht Van Lommel
Date:   Sun Feb 23 09:14:52 2020 +0100
Branches: master
https://developer.blender.org/rB99436acde8fbb7381f095922bb61455b0c8fb9a9

Cycles: enable Embree by default for CPU rendering

For GPU debugging purposes, it is still possible to render with the same BVH2
on the CPU using the Debug panel in the render properties.

Note that building Blender without Embree will now lead to significantly reduced
performance in CPU rendering, and a few of the Cycles regression tests will fail
due to small pixel differences.

Ref T73778

Depends on D8014

Maniphest Tasks: T73778

Differential Revision: https://developer.blender.org/D8015

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

M	CMakeLists.txt
M	intern/cycles/blender/addon/properties.py
M	intern/cycles/blender/blender_sync.cpp
M	intern/cycles/kernel/kernel_types.h

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac6f54cd5b4..6864c206bea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -370,7 +370,7 @@ option(WITH_CYCLES                  "Enable Cycles Render Engine" ON)
 option(WITH_CYCLES_STANDALONE       "Build Cycles standalone application" OFF)
 option(WITH_CYCLES_STANDALONE_GUI   "Build Cycles standalone with GUI" OFF)
 option(WITH_CYCLES_OSL              "Build Cycles with OSL support" ON)
-option(WITH_CYCLES_EMBREE           "Build Cycles with Embree support" OFF)
+option(WITH_CYCLES_EMBREE           "Build Cycles with Embree support" ON)
 option(WITH_CYCLES_CUDA_BINARIES    "Build Cycles CUDA binaries" OFF)
 option(WITH_CYCLES_CUBIN_COMPILER   "Build cubins with nvrtc based compiler instead of nvcc" OFF)
 option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 269ad8ecc5b..b7e9b1511ec 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -53,6 +53,11 @@ enum_displacement_methods = (
     ('BOTH', "Displacement and Bump", "Combination of true displacement and bump mapping for finer detail"),
 )
 
+enum_bvh_layouts = (
+    ('BVH2', "BVH2", "", 1),
+    ('EMBREE', "Embree", "", 4),
+)
+
 enum_bvh_types = (
     ('DYNAMIC_BVH', "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
     ('STATIC_BVH', "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
@@ -612,11 +617,6 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
         items=enum_bvh_types,
         default='DYNAMIC_BVH',
     )
-    use_bvh_embree: BoolProperty(
-        name="Use Embree",
-        description="Use Embree as ray accelerator",
-        default=False,
-    )
     debug_use_spatial_splits: BoolProperty(
         name="Use Spatial Splits",
         description="Use BVH spatial splits: longer builder time, faster render",
@@ -766,6 +766,11 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
     debug_use_cpu_sse41: BoolProperty(name="SSE41", default=True)
     debug_use_cpu_sse3: BoolProperty(name="SSE3", default=True)
     debug_use_cpu_sse2: BoolProperty(name="SSE2", default=True)
+    debug_bvh_layout: EnumProperty(
+        name="BVH Layout",
+        items=enum_bvh_layouts,
+        default='EMBREE',
+    )
     debug_use_cpu_split_kernel: BoolProperty(name="Split Kernel", default=False)
 
     debug_use_cuda_adaptive_compile: BoolProperty(name="Adaptive Compile", default=False)
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index 7a6047ca6a6..b40c8434395 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -757,11 +757,6 @@ SceneParams BlenderSync::get_scene_params(BL::Scene &b_scene, bool background)
 
   params.bvh_layout = DebugFlags().cpu.bvh_layout;
 
-#ifdef WITH_EMBREE
-  params.bvh_layout = RNA_boolean_get(&cscene, "use_bvh_embree") ? BVH_LAYOUT_EMBREE :
-                                                                   params.bvh_layout;
-#endif
-
   params.background = background;
 
   return params;
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index ff0f6bd1fbe..fc9cc73a704 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -1400,7 +1400,8 @@ typedef enum KernelBVHLayout {
   BVH_LAYOUT_EMBREE = (1 << 1),
   BVH_LAYOUT_OPTIX = (1 << 2),
 
-  BVH_LAYOUT_AUTO = BVH_LAYOUT_BVH2,
+  /* Default BVH layout to use for CPU. */
+  BVH_LAYOUT_AUTO = BVH_LAYOUT_EMBREE,
   BVH_LAYOUT_ALL = (unsigned int)(~0u),
 } KernelBVHLayout;



More information about the Bf-blender-cvs mailing list