diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-05-02 01:05:16 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-05-05 22:43:46 +0300 |
commit | dd8bfa0929f9f1ae940e7da0468fbdd6744e50bb (patch) | |
tree | b4bfab7872a9ce0ea32f25cfe46547e41d5de601 /intern/cycles/render/graph.h | |
parent | 2cfadecf97b8c7be5e24ea387c8aef34e9f0a1e9 (diff) |
Code refactor: reduce special node types, use generic constant folding.
Diffstat (limited to 'intern/cycles/render/graph.h')
-rw-r--r-- | intern/cycles/render/graph.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h index 214199a1c52..2236f51957c 100644 --- a/intern/cycles/render/graph.h +++ b/intern/cycles/render/graph.h @@ -76,15 +76,11 @@ enum ShaderBump { enum ShaderNodeSpecialType { SHADER_SPECIAL_TYPE_NONE, SHADER_SPECIAL_TYPE_PROXY, - SHADER_SPECIAL_TYPE_MIX_CLOSURE, - SHADER_SPECIAL_TYPE_MIX_RGB, /* Only Mix subtype */ SHADER_SPECIAL_TYPE_AUTOCONVERT, SHADER_SPECIAL_TYPE_GEOMETRY, SHADER_SPECIAL_TYPE_SCRIPT, - SHADER_SPECIAL_TYPE_BACKGROUND, SHADER_SPECIAL_TYPE_IMAGE_SLOT, SHADER_SPECIAL_TYPE_CLOSURE, - SHADER_SPECIAL_TYPE_EMISSION, SHADER_SPECIAL_TYPE_BUMP, }; @@ -197,7 +193,7 @@ public: /* ** Node optimization ** */ /* Check whether the node can be replaced with single constant. */ - virtual bool constant_fold(ShaderOutput * /*socket*/, float3 * /*optimized_value*/) { return false; } + virtual bool constant_fold(ShaderGraph * /*graph*/, ShaderOutput * /*socket*/, float3 * /*optimized_value*/) { return false; } /* Simplify settings used by artists to the ones which are simpler to * evaluate in the kernel but keep the final result unchanged. @@ -307,9 +303,9 @@ public: void connect(ShaderOutput *from, ShaderInput *to); void disconnect(ShaderInput *to); - void relink(vector<ShaderInput*> inputs, vector<ShaderInput*> outputs, ShaderOutput *output); + void relink(ShaderNode *node, ShaderOutput *from, ShaderOutput *to); - void remove_unneeded_nodes(); + void remove_proxy_nodes(); void finalize(Scene *scene, bool do_bump = false, bool do_osl = false, |