[Bf-blender-cvs] [38c4f401595] blender-v3.4-release: Fix Cycles OSL issue with constant folding after recent fix

Brecht Van Lommel noreply at git.blender.org
Thu Nov 24 17:54:48 CET 2022


Commit: 38c4f401595d19ad33d5d0fb460e81226ad83cc2
Author: Brecht Van Lommel
Date:   Thu Nov 24 16:59:37 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rB38c4f401595d19ad33d5d0fb460e81226ad83cc2

Fix Cycles OSL issue with constant folding after recent fix

Constant folded values from linked nodes should override the OSL initializer.

Ref T102450

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

M	intern/cycles/scene/osl.cpp

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

diff --git a/intern/cycles/scene/osl.cpp b/intern/cycles/scene/osl.cpp
index 2ff36ff7fca..825831652f1 100644
--- a/intern/cycles/scene/osl.cpp
+++ b/intern/cycles/scene/osl.cpp
@@ -720,7 +720,7 @@ void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath)
       if (node_skip_input(node, input)) {
         continue;
       }
-      if (input->flags() & SocketType::LINK_OSL_INITIALIZER) {
+      if ((input->flags() & SocketType::LINK_OSL_INITIALIZER) && !(input->constant_folded_in)) {
         continue;
       }



More information about the Bf-blender-cvs mailing list