Commit: 0c82c0c75880814cd12bb9c349e95b7c6fc440e6
Author: Sergey Sharybin
Date:   Mon Sep 13 17:20:17 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB0c82c0c75880814cd12bb9c349e95b7c6fc440e6

Fix missing shadow catcher pass in viewport

The regression was caused by changes related on GPUDisplay used for
an offline rendering.

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

M       intern/cycles/integrator/path_trace_work.cpp
M       intern/cycles/render/buffers.cpp
M       intern/cycles/render/buffers.h

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

diff --git a/intern/cycles/integrator/path_trace_work.cpp 
b/intern/cycles/integrator/path_trace_work.cpp
index 32e8a436ca0..98ea541207b 100644
--- a/intern/cycles/integrator/path_trace_work.cpp
+++ b/intern/cycles/integrator/path_trace_work.cpp
@@ -162,8 +162,10 @@ PassAccessor::PassAccessInfo 
PathTraceWork::get_display_pass_access_info(PassMod
 
   const BufferParams &params = buffers_->params;
 
+  const BufferPass *display_pass = 
params.get_actual_display_pass(film_->get_display_pass());
+
   PassAccessor::PassAccessInfo pass_access_info;
-  pass_access_info.type = film_->get_display_pass();
+  pass_access_info.type = display_pass->type;
   pass_access_info.offset = PASS_UNUSED;
 
   if (pass_mode == PassMode::DENOISED) {
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp
index a6fce4cb3c3..78f7076c34e 100644
--- a/intern/cycles/render/buffers.cpp
+++ b/intern/cycles/render/buffers.cpp
@@ -145,6 +145,12 @@ const BufferPass *BufferParams::find_pass(PassType type, 
PassMode mode) const
   return nullptr;
 }
 
+const BufferPass *BufferParams::get_actual_display_pass(PassType type, 
PassMode mode) const
+{
+  const BufferPass *pass = find_pass(type, mode);
+  return get_actual_display_pass(pass);
+}
+
 const BufferPass *BufferParams::get_actual_display_pass(const BufferPass 
*pass) const
 {
   if (!pass) {
diff --git a/intern/cycles/render/buffers.h b/intern/cycles/render/buffers.h
index 2e6f689e5c7..e192bc4baff 100644
--- a/intern/cycles/render/buffers.h
+++ b/intern/cycles/render/buffers.h
@@ -94,6 +94,7 @@ class BufferParams {
 
   /* Get display pass from its name.
    * Will do special logic to replace combined pass with shadow catcher matte. 
*/
+  const BufferPass *get_actual_display_pass(PassType type, PassMode mode = 
PassMode::NOISY) const;
   const BufferPass *get_actual_display_pass(const BufferPass *pass) const;
 
   void update_offset_stride();

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to