From 4b00a779ecf8173c476e3c9356576d56098da62d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 9 Dec 2021 18:01:26 +0100 Subject: Fix T93890: Cycles error with shadow catcher + OptiX denoise without passes --- intern/cycles/device/optix/device_impl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'intern/cycles/device') 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."; -- cgit v1.2.3