diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-12-09 20:01:26 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-12-09 20:01:26 +0300 |
commit | 4b00a779ecf8173c476e3c9356576d56098da62d (patch) | |
tree | afe6365092b298ee79535844184f472df2e94f4e /intern/cycles/device | |
parent | 56fa6f58a0f8aaf2fa23fd08e6b104816b3af2e1 (diff) |
Fix T93890: Cycles error with shadow catcher + OptiX denoise without passes
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/optix/device_impl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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."; |