[Bf-blender-cvs] [88db9a17ce7] master: Fix T74393: Cycles crashes when both OSL and Optix Denoising are enabled

Patrick Mours noreply at git.blender.org
Thu Mar 5 16:29:11 CET 2020


Commit: 88db9a17ce70c4553be1922e3ecef091e8c1d039
Author: Patrick Mours
Date:   Thu Mar 5 16:28:31 2020 +0100
Branches: master
https://developer.blender.org/rB88db9a17ce70c4553be1922e3ecef091e8c1d039

Fix T74393: Cycles crashes when both OSL and Optix Denoising are enabled

Enabling viewport denoising causes Cycles to use a multi-device, which always returned NULL when
asked for OSL memory and would subsequently crash. This fixes that by returning the correct OSL
memory pointer from the CPU device in the special viewport denoising multi-device.

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

M	intern/cycles/device/device_multi.cpp

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

diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp
index 0044610eeb4..631c4169e2e 100644
--- a/intern/cycles/device/device_multi.cpp
+++ b/intern/cycles/device/device_multi.cpp
@@ -183,6 +183,14 @@ class MultiDevice : public Device {
     return true;
   }
 
+  virtual void *osl_memory()
+  {
+    if (devices.size() > 1) {
+      return NULL;
+    }
+    return devices.front().device->osl_memory();
+  }
+
   void mem_alloc(device_memory &mem)
   {
     device_ptr key = unique_key++;



More information about the Bf-blender-cvs mailing list