Currently there is no clear way to know if an operation is constant,
i.e. when all rendered elements (or pixels) have same values.
Operations may need to get constant inputs values before rendering
to determine their resolution or areas of interest. This is the case
of input parameters for scale, rotate and translate operations. Only
"set operations" are known to be constant but there are many more
operations that are constant when all their inputs are so.
Such cases can be optimized by only rendering one element.
Current solution for tiled implementation is to get first element
from input. This works only for root execution groups, others
need previous groups to be rendered.
On full frame implementation this is not possible, because buffers
are created on rendering to reduce peak memory and there is
no per pixel calls.
This patch solution is to evaluate all operations that are constant
into primitive operations (Value/Vector/Color) before
determining resolutions.
I haven't enabled can_be_constant flag on any operation.
The idea is check which ones can be constant for each full frame
node patch.
Test case enabling can_be_constant flag on brightness operation:
Graphviz prior folding:
Graphviz after folding:

