[Bf-blender-cvs] [7f15bd31816] cycles-x: Cycles X: Store information whether pass needs compositing on read

Sergey Sharybin noreply at git.blender.org
Tue Jun 15 12:04:12 CEST 2021


Commit: 7f15bd3181609334d53ab16d69f72258a367009c
Author: Sergey Sharybin
Date:   Fri Jun 11 18:57:47 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB7f15bd3181609334d53ab16d69f72258a367009c

Cycles X: Store information whether pass needs compositing on read

Currently unused, but will allow to properly feed pixels to the
denoiser (ignoring possible optimizations related on general scaling
rules).

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

M	intern/cycles/render/pass.cpp
M	intern/cycles/render/pass.h

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

diff --git a/intern/cycles/render/pass.cpp b/intern/cycles/render/pass.cpp
index e9a1e45c807..ce215c5bc9a 100644
--- a/intern/cycles/render/pass.cpp
+++ b/intern/cycles/render/pass.cpp
@@ -243,6 +243,7 @@ PassInfo Pass::get_info(PassType type)
   pass_info.use_exposure = false;
   pass_info.divide_type = PASS_NONE;
   pass_info.is_aligned = true;
+  pass_info.use_compositing = false;
 
   switch (type) {
     case PASS_NONE:
@@ -343,10 +344,14 @@ PassInfo Pass::get_info(PassType type)
     case PASS_SHADOW_CATCHER:
       pass_info.num_components = 4;
       pass_info.use_exposure = true;
+      pass_info.use_compositing = true;
       break;
     case PASS_SHADOW_CATCHER_MATTE:
       pass_info.num_components = 4;
       pass_info.use_exposure = true;
+      /* Without shadow catcher approximation compositing is not needed.
+       * Since we don't know here whether approximation is used or not, leave the decision up to
+       * the caller which will know that. */
       break;
 
     case PASS_ADAPTIVE_AUX_BUFFER:
@@ -380,6 +385,10 @@ PassInfo Pass::get_info(PassType type)
       break;
   }
 
+  if (pass_info.divide_type != PASS_NONE) {
+    pass_info.use_compositing = true;
+  }
+
   return pass_info;
 }
 
diff --git a/intern/cycles/render/pass.h b/intern/cycles/render/pass.h
index 9581e4b1957..2225e9fec52 100644
--- a/intern/cycles/render/pass.h
+++ b/intern/cycles/render/pass.h
@@ -46,6 +46,10 @@ struct PassInfo {
    * For example, if the pass with 3 components is stored (and written by the kernel) as individual
    * float components. */
   bool is_aligned = true;
+
+  /* Pass access for read can not happen directly and needs some sort of compositing (for example,
+   * light passes due to divide_type, or shadow catcher pass. */
+  bool use_compositing = false;
 };
 
 class Pass : public Node {



More information about the Bf-blender-cvs mailing list