[Bf-blender-cvs] [c0af75f1981] cycles-x: Fix possible use of stalled data in Cycles X OIDN denoiser

Sergey Sharybin noreply at git.blender.org
Fri Jun 11 19:09:46 CEST 2021


Commit: c0af75f1981cdb92a918649efb208a3c49f9b69c
Author: Sergey Sharybin
Date:   Fri Jun 11 17:36:48 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBc0af75f1981cdb92a918649efb208a3c49f9b69c

Fix possible use of stalled data in Cycles X OIDN denoiser

The denoiser object is only re-created if denoiser type changes.
Need to manually ensure implementation is up-to-date with the
new parameters.

Solves possible issues with denoiser using image from previous
execution (in viewport render, enable normal pass, then disable
it).

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

M	intern/cycles/integrator/denoiser_oidn.cpp

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

diff --git a/intern/cycles/integrator/denoiser_oidn.cpp b/intern/cycles/integrator/denoiser_oidn.cpp
index 3c015ce2dbe..ac584be9efd 100644
--- a/intern/cycles/integrator/denoiser_oidn.cpp
+++ b/intern/cycles/integrator/denoiser_oidn.cpp
@@ -44,6 +44,9 @@ class OIDNDenoiser::State {
 #ifdef WITH_OPENIMAGEDENOISE
   oidn::DeviceRef oidn_device;
   oidn::FilterRef oidn_filter;
+
+  bool use_pass_albedo = false;
+  bool use_pass_normal = false;
 #endif
 };
 
@@ -277,6 +280,13 @@ void OIDNDenoiser::initialize()
     state_->oidn_device.commit();
   }
 
+  if (state_->oidn_filter) {
+    if (params_.use_pass_albedo != state_->use_pass_albedo ||
+        params_.use_pass_normal != state_->use_pass_normal) {
+      state_->oidn_filter = nullptr;
+    }
+  }
+
   if (!state_->oidn_filter) {
     state_->oidn_filter = state_->oidn_device.newFilter("RT");
     state_->oidn_filter.set("hdr", true);



More information about the Bf-blender-cvs mailing list