diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2016-07-16 14:16:54 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-07-18 23:54:30 +0300 |
commit | 5234e9ddd3ecefcf3a48d1f41e4dc18b89627f72 (patch) | |
tree | c30b3147018e688e46e5215287df2894a667f0d1 /intern/cycles/render/graph.h | |
parent | 10b0e33de1b9b57693ebcec7d503d3b204043f56 (diff) |
Cycles: add ConstantFolder class for constant folding boilerplate.
Reviewed By: brecht, sergey
Differential Revision: https://developer.blender.org/D2089
Diffstat (limited to 'intern/cycles/render/graph.h')
-rw-r--r-- | intern/cycles/render/graph.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h index 61100cda60b..b35be48d8ca 100644 --- a/intern/cycles/render/graph.h +++ b/intern/cycles/render/graph.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Blender Foundation + * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,7 @@ class ShaderGraph; class SVMCompiler; class OSLCompiler; class OutputNode; +class ConstantFolder; /* Bump * @@ -140,9 +141,7 @@ public: /* ** Node optimization ** */ /* Check whether the node can be replaced with single constant. */ - virtual bool constant_fold(ShaderGraph * /*graph*/, ShaderOutput * /*socket*/, ShaderInput * /*optimized*/) { return false; } - - bool all_inputs_constant() const; + virtual void constant_fold(const ConstantFolder& /*folder*/) {} /* Simplify settings used by artists to the ones which are simpler to * evaluate in the kernel but keep the final result unchanged. @@ -251,6 +250,7 @@ public: OutputNode *output(); void connect(ShaderOutput *from, ShaderInput *to); + void disconnect(ShaderOutput *from); void disconnect(ShaderInput *to); void relink(ShaderNode *node, ShaderOutput *from, ShaderOutput *to); |