From 626201683ec0d96e86d681bb0273a324cdf91916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Tue, 22 Sep 2020 14:47:10 +0200 Subject: Cycles: add update flags to Node and SocketType Those flags are meant for detecting which socket has changed, so in the future we can have more granular updates. `Node` now stores an `update_flags` member which is modified every time a socket is changed though `Node::set`. The flags are or-able bits stored in `SocketType` instances. Each `SocketType` stores a unique bit out of 64, for the 64 bits of an uint64_t; the bit corresponds to the index of the socket in the `Node`'s sockets array + 1, so the socket at index 5 will have the 6th bit set as its flag. This limits us to 64 sockets per Node, which should be plenty for the current set of `Nodes` that we have. This does not change the behavior of other parts of Cycles. This is part of T79131. Reviewed By: brecht Maniphest Tasks: T79131 Differential Revision: https://developer.blender.org/D8644 --- intern/cycles/graph/node_type.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'intern/cycles/graph/node_type.h') diff --git a/intern/cycles/graph/node_type.h b/intern/cycles/graph/node_type.h index a79d44b82f3..0d182945e16 100644 --- a/intern/cycles/graph/node_type.h +++ b/intern/cycles/graph/node_type.h @@ -28,6 +28,8 @@ CCL_NAMESPACE_BEGIN struct Node; struct NodeType; +typedef uint64_t SocketModifiedFlags; + /* Socket Type */ struct SocketType { @@ -88,6 +90,7 @@ struct SocketType { const NodeType **node_type; int flags; ustring ui_name; + SocketModifiedFlags modified_flag_bit; size_t size() const; bool is_array() const; -- cgit v1.2.3