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:
Diffstat (limited to 'intern/cycles/graph/node.cpp')
-rw-r--r--intern/cycles/graph/node.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/intern/cycles/graph/node.cpp b/intern/cycles/graph/node.cpp
index 10d91a1e4ef..c71221746ad 100644
--- a/intern/cycles/graph/node.cpp
+++ b/intern/cycles/graph/node.cpp
@@ -18,6 +18,7 @@
#include "graph/node_type.h"
#include "util/util_foreach.h"
+#include "util/util_md5.h"
#include "util/util_param.h"
#include "util/util_transform.h"
@@ -403,5 +404,24 @@ bool Node::equals(const Node& other) const
return true;
}
+/* Hash */
+
+void Node::hash(MD5Hash& md5)
+{
+ md5.append(type->name.string());
+
+ foreach(const SocketType& socket, type->inputs) {
+ md5.append(socket.name.string());
+
+ if(socket.is_array()) {
+ const array<bool>* a = (const array<bool>*)(((char*)this) + socket.struct_offset);
+ md5.append((uint8_t*)a->data(), socket.size() * a->size());
+ }
+ else {
+ md5.append(((uint8_t*)this) + socket.struct_offset, socket.size());
+ }
+ }
+}
+
CCL_NAMESPACE_END