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

This commit is contained in:
Brecht Van Lommel
2017-07-03 05:25:27 +02:00
parent cda24d0853
commit f5535fcb83

View File

@@ -160,8 +160,15 @@ bool ConstantFolder::try_bypass_or_make_constant(ShaderInput *input, bool clamp)
bypass(input->link); bypass(input->link);
return true; return true;
} }
else {
return false; /* 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 bool ConstantFolder::is_zero(ShaderInput *input) const