diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-07-03 06:25:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-07-03 06:25:27 +0300 |
commit | f5535fcb83fd7c1374697923b43565c9e303d225 (patch) | |
tree | cc5d30b9615dfba0f5c5b92a95004f570a6db56a /intern | |
parent | cda24d085396f694402d67841640db27a2d1bcce (diff) |
Fi T51023: MixRGB constant folding not effective with clamp option.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/render/constant_fold.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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 |