[Bf-blender-cvs] [4b00a779ecf] master: Fix T93890: Cycles error with shadow catcher + OptiX denoise without passes

Brecht Van Lommel noreply at git.blender.org
Thu Dec 9 18:29:27 CET 2021


Commit: 4b00a779ecf8173c476e3c9356576d56098da62d
Author: Brecht Van Lommel
Date:   Thu Dec 9 18:01:26 2021 +0100
Branches: master
https://developer.blender.org/rB4b00a779ecf8173c476e3c9356576d56098da62d

Fix T93890: Cycles error with shadow catcher + OptiX denoise without passes

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

M	intern/cycles/device/optix/device_impl.cpp

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

diff --git a/intern/cycles/device/optix/device_impl.cpp b/intern/cycles/device/optix/device_impl.cpp
index da3c1ac57d1..11786f4a6e2 100644
--- a/intern/cycles/device/optix/device_impl.cpp
+++ b/intern/cycles/device/optix/device_impl.cpp
@@ -538,9 +538,9 @@ class OptiXDevice::DenoiseContext {
       }
     }
 
-    const int num_guiding_passes = num_input_passes - 1;
+    use_guiding_passes = (num_input_passes - 1) > 0;
 
-    if (num_guiding_passes) {
+    if (use_guiding_passes) {
       if (task.allow_inplace_modification) {
         guiding_params.device_pointer = render_buffers->buffer.device_pointer;
 
@@ -593,6 +593,7 @@ class OptiXDevice::DenoiseContext {
 
   /* Number of input passes. Including the color and extra auxiliary passes. */
   int num_input_passes = 0;
+  bool use_guiding_passes = false;
   bool use_pass_albedo = false;
   bool use_pass_normal = false;
 
@@ -724,7 +725,7 @@ void OptiXDevice::denoise_pass(DenoiseContext &context, PassType pass_type)
       return;
     }
   }
-  else if (!context.albedo_replaced_with_fake) {
+  else if (context.use_guiding_passes && !context.albedo_replaced_with_fake) {
     context.albedo_replaced_with_fake = true;
     if (!denoise_filter_guiding_set_fake_albedo(context)) {
       LOG(ERROR) << "Error replacing real albedo with the fake one.";



More information about the Bf-blender-cvs mailing list