Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2016-05-29 14:26:41 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2016-05-29 21:30:16 +0300
commitaf073e149b3c734f70bb13f20a4e18682885342e (patch)
treecc750c91ae084be0913ba39a6d7691d3b7cadeef /intern/cycles/render/graph.h
parent9bd2820aaf599bb25a19cdb6b548957b6686eadc (diff)
Code refactor: pass ShaderInput to constant_fold, so it supports arbitrary types.
Diffstat (limited to 'intern/cycles/render/graph.h')
-rw-r--r--intern/cycles/render/graph.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h
index 760b19f447a..882e495df20 100644
--- a/intern/cycles/render/graph.h
+++ b/intern/cycles/render/graph.h
@@ -85,6 +85,11 @@ public:
int flags() { return flags_; }
SocketType::Type type() { return type_; }
+ void set(float f) { value_.x = f; }
+ void set(float3 f) { value_ = f; }
+ void set(int i) { value_.x = (float)i; }
+ void set(ustring s) { value_string_ = s; }
+
float3& value() { return value_; }
float& value_float() { return value_.x; }
ustring& value_string() { return value_string_; }
@@ -148,7 +153,7 @@ public:
/* ** Node optimization ** */
/* Check whether the node can be replaced with single constant. */
- virtual bool constant_fold(ShaderGraph * /*graph*/, ShaderOutput * /*socket*/, float3 * /*optimized_value*/) { return false; }
+ virtual bool constant_fold(ShaderGraph * /*graph*/, ShaderOutput * /*socket*/, ShaderInput * /*optimized*/) { return false; }
/* Simplify settings used by artists to the ones which are simpler to
* evaluate in the kernel but keep the final result unchanged.