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
diff options
context:
space:
mode:
authorPatrick Mours <pmours@nvidia.com>2020-09-15 15:57:49 +0300
committerPatrick Mours <pmours@nvidia.com>2020-09-15 15:58:19 +0300
commit9f12ea496a3f6a0a066e3ed6ec557cc9ec37d776 (patch)
tree996d4db9fcd748367497050613e29f302d6393df /intern/cycles/device/device_multi.cpp
parentcd849076d2bc61a077a2ef072a0f2eac258ff822 (diff)
Fix T80477: Crash when rendering with Embree but denoising with OptiX
Commit 009971ba7adc9603b90e9bf99b6b6d53eeae6c3a changed it so Cycles creates a separate Embree device for each Cycles device, but missed the multi-device case. A multi-device with Embree BVH can occur when CPU rendering is used with OptiX denoising and BVH creation then failed to get a valid pointer to the Embree device, which crashed. This fixes that by providing the correct device pointer in the multi-device case as well.
Diffstat (limited to 'intern/cycles/device/device_multi.cpp')
-rw-r--r--intern/cycles/device/device_multi.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp
index 9ea8782d0f0..2e72a0b4393 100644
--- a/intern/cycles/device/device_multi.cpp
+++ b/intern/cycles/device/device_multi.cpp
@@ -237,6 +237,13 @@ class MultiDevice : public Device {
return true;
}
+ virtual void *bvh_device() const
+ {
+ /* CPU devices will always be at the back, so simply choose the last one.
+ There should only ever be one CPU device anyway and we need the Embree device for it. */
+ return devices.back().device->bvh_device();
+ }
+
virtual void *osl_memory()
{
if (devices.size() > 1) {