[Bf-blender-cvs] [b046bc536be] master: Fix T88096: Baking with OptiX and displacement fails

Patrick Mours noreply at git.blender.org
Tue May 25 16:56:42 CEST 2021


Commit: b046bc536bec914013c678b552ce6cef7dd308e6
Author: Patrick Mours
Date:   Tue May 25 16:56:16 2021 +0200
Branches: master
https://developer.blender.org/rBb046bc536bec914013c678b552ce6cef7dd308e6

Fix T88096: Baking with OptiX and displacement fails

Using displacement runs the shader eval kernel, but since OptiX modules are not loaded when
baking is active, those were not available and therefore failed to launch. This fixes that by falling
back to the CUDA kernels.

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

M	intern/cycles/device/device_optix.cpp

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

diff --git a/intern/cycles/device/device_optix.cpp b/intern/cycles/device/device_optix.cpp
index 01de0724cb2..b008dfa376f 100644
--- a/intern/cycles/device/device_optix.cpp
+++ b/intern/cycles/device/device_optix.cpp
@@ -726,7 +726,11 @@ class OptiXDevice : public CUDADevice {
       }
     }
     else if (task.type == DeviceTask::SHADER) {
-      launch_shader_eval(task, thread_index);
+      // CUDA kernels are used when doing baking
+      if (optix_module == NULL)
+        CUDADevice::shader(task);
+      else
+        launch_shader_eval(task, thread_index);
     }
     else if (task.type == DeviceTask::DENOISE_BUFFER) {
       // Set up a single tile that covers the whole task and denoise it



More information about the Bf-blender-cvs mailing list