[Bf-blender-cvs] [3373d14b1b0] master: Fix T83925: Crash when rendering on the CPU with OptiX denoiser enabled

Patrick Mours noreply at git.blender.org
Tue Jan 5 18:37:53 CET 2021


Commit: 3373d14b1b05b2ee5dc88efff5dc8b1a5fe20f36
Author: Patrick Mours
Date:   Tue Jan 5 18:37:31 2021 +0100
Branches: master
https://developer.blender.org/rB3373d14b1b05b2ee5dc88efff5dc8b1a5fe20f36

Fix T83925: Crash when rendering on the CPU with OptiX denoiser enabled

Rendering on the CPU uses the Embree BVH layout, whether the OptiX denoiser is enabled or not.
This means the "build_bvh" function gets a "BVHEmbree" object to fill and not a "BVHMulti" as it
was assuming before, which caused crashes due to memory geting overwritten incorrectly. This
fixes that by redirecting Embree BVH builds to the Embree device.

Manifest Tasks: T83925

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

M	intern/cycles/device/device_multi.cpp

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

diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp
index e5b138917ff..44959577fb5 100644
--- a/intern/cycles/device/device_multi.cpp
+++ b/intern/cycles/device/device_multi.cpp
@@ -248,11 +248,14 @@ class MultiDevice : public Device {
   void build_bvh(BVH *bvh, Progress &progress, bool refit) override
   {
     /* Try to build and share a single acceleration structure, if possible */
-    if (bvh->params.bvh_layout == BVH_LAYOUT_BVH2) {
+    if (bvh->params.bvh_layout == BVH_LAYOUT_BVH2 || bvh->params.bvh_layout == BVH_LAYOUT_EMBREE) {
       devices.back().device->build_bvh(bvh, progress, refit);
       return;
     }
 
+    assert(bvh->params.bvh_layout == BVH_LAYOUT_MULTI_OPTIX ||
+           bvh->params.bvh_layout == BVH_LAYOUT_MULTI_OPTIX_EMBREE);
+
     BVHMulti *const bvh_multi = static_cast<BVHMulti *>(bvh);
     bvh_multi->sub_bvhs.resize(devices.size());



More information about the Bf-blender-cvs mailing list