[Bf-blender-cvs] [2f8b0c0a85d] cycles-x: Fix pass offset calculation in Cycles X

Sergey Sharybin noreply at git.blender.org
Fri Jun 11 18:54:10 CEST 2021


Commit: 2f8b0c0a85db8b54460fbb51ba084ce5eec03ae0
Author: Sergey Sharybin
Date:   Fri Jun 11 18:53:07 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB2f8b0c0a85db8b54460fbb51ba084ce5eec03ae0

Fix pass offset calculation in Cycles X

Caused by recent refactor.

In the typical load did not notice that name could be empty:
happens when Combined pass is replaced with Shadow Catcher Matte.

Additionally, return PASS_UNUSED for passes which are not written.

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

M	intern/cycles/render/pass.cpp

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

diff --git a/intern/cycles/render/pass.cpp b/intern/cycles/render/pass.cpp
index a39bb964405..e9a1e45c807 100644
--- a/intern/cycles/render/pass.cpp
+++ b/intern/cycles/render/pass.cpp
@@ -528,10 +528,15 @@ int Pass::get_offset(const vector<Pass> &passes, const Pass &pass)
   int pass_offset = 0;
 
   for (const Pass &current_pass : passes) {
-    if (current_pass.name == pass.name) {
-      DCHECK_EQ(current_pass.type, pass.type);
-      DCHECK_EQ(current_pass.mode, pass.mode);
-      return pass_offset;
+    /* Note that pass name is allowed to be empty. This is why we check for type and mode. */
+    if (current_pass.type == pass.type && current_pass.mode == pass.mode &&
+        current_pass.name == pass.name) {
+      if (current_pass.is_written()) {
+        return pass_offset;
+      }
+      else {
+        return PASS_UNUSED;
+      }
     }
     if (current_pass.is_written()) {
       pass_offset += current_pass.get_info().num_components;



More information about the Bf-blender-cvs mailing list