[Bf-blender-cvs] [f5535fcb83f] master: Fi T51023: MixRGB constant folding not effective with clamp option.

Brecht Van Lommel noreply at git.blender.org
Mon Jul 3 05:45:43 CEST 2017


Commit: f5535fcb83fd7c1374697923b43565c9e303d225
Author: Brecht Van Lommel
Date:   Mon Jul 3 05:25:27 2017 +0200
Branches: master
https://developer.blender.org/rBf5535fcb83fd7c1374697923b43565c9e303d225

Fi T51023: MixRGB constant folding not effective with clamp option.

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

M	intern/cycles/render/constant_fold.cpp

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

diff --git a/intern/cycles/render/constant_fold.cpp b/intern/cycles/render/constant_fold.cpp
index 2569d9eec27..9db875ea4f1 100644
--- a/intern/cycles/render/constant_fold.cpp
+++ b/intern/cycles/render/constant_fold.cpp
@@ -160,8 +160,15 @@ bool ConstantFolder::try_bypass_or_make_constant(ShaderInput *input, bool clamp)
 		bypass(input->link);
 		return true;
 	}
-
-	return false;
+	else {
+		/* disconnect other inputs if we can't fully bypass due to clamp */
+		foreach(ShaderInput *other, node->inputs) {
+			if(other != input && other->link) {
+				graph->disconnect(other);
+			}
+		}
+		return false;
+	}
 }
 
 bool ConstantFolder::is_zero(ShaderInput *input) const




More information about the Bf-blender-cvs mailing list