Cycles: constant fold add/mul type nodes with known 0 and 1 arguments.
authorAlexander Gavrilov <angavrilov@gmail.com>
Sat, 30 Jul 2016 18:03:49 +0000 (20:03 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 31 Jul 2016 00:34:34 +0000 (02:34 +0200)
commit1776f75c3b3621a28ed7af535192ce7f05faea8f
tree65df1e88a03007dd12444f73308292fd66eb9f06
parentea2ebf7a00f9adef9c14aaa24b79532b44043eba
Cycles: constant fold add/mul type nodes with known 0 and 1 arguments.

These values often either turn the node into a no-op, or even make it
evaluate to 0 no matter what the other input value is, thus allowing
deletion of a branch of the node graph that otherwise is not constant.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2085
intern/cycles/render/constant_fold.cpp
intern/cycles/render/constant_fold.h
intern/cycles/render/nodes.cpp