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:
authorJacques Lucke <jacques@blender.org>2022-05-30 16:31:13 +0300
committerJacques Lucke <jacques@blender.org>2022-05-30 16:32:16 +0300
commit6a59cf053091dc45e0f94b829bee6c34cf940534 (patch)
tree92a8cc37cfe3e367846910623c1e82c3d9e4430f /source/blender/makesdna
parent1f858772638d61a20add3d4c9cdbb6e20e24ff15 (diff)
Nodes: add separately allocated runtime data for nodes and sockets
This is a follow up to rBbb0fc675822f313c5546a2498a162472c2571ecb. Now the same kind of run-time data is added to nodes and sockets. Differential Revision: https://developer.blender.org/D15060
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_node_types.h42
1 files changed, 10 insertions, 32 deletions
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 0ac61d7d062..a0738883bf3 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -73,14 +73,20 @@ class SocketDeclaration;
} // namespace blender::nodes
namespace blender::bke {
class bNodeTreeRuntime;
-}
+class bNodeRuntime;
+class bNodeSocketRuntime;
+} // namespace blender::bke
using NodeDeclarationHandle = blender::nodes::NodeDeclaration;
using SocketDeclarationHandle = blender::nodes::SocketDeclaration;
using bNodeTreeRuntimeHandle = blender::bke::bNodeTreeRuntime;
+using bNodeRuntimeHandle = blender::bke::bNodeRuntime;
+using bNodeSocketRuntimeHandle = blender::bke::bNodeSocketRuntime;
#else
typedef struct NodeDeclarationHandle NodeDeclarationHandle;
typedef struct SocketDeclarationHandle SocketDeclarationHandle;
typedef struct bNodeTreeRuntimeHandle bNodeTreeRuntimeHandle;
+typedef struct bNodeRuntimeHandle bNodeRuntimeHandle;
+typedef struct bNodeSocketRuntimeHandle bNodeSocketRuntimeHandle;
#endif
typedef struct bNodeSocket {
@@ -174,15 +180,7 @@ typedef struct bNodeSocket {
/** Custom data for inputs, only UI writes in this. */
bNodeStack ns DNA_DEPRECATED;
- /**
- * References a socket declaration that is owned by `node->declaration`. This is only runtime
- * data. It has to be updated when the node declaration changes.
- */
- const SocketDeclarationHandle *declaration;
-
- /** #eNodeTreeChangedFlag. */
- uint32_t changed_flag;
- char _pad[4];
+ bNodeSocketRuntimeHandle *runtime;
} bNodeSocket;
/** #bNodeSocket.type & #bNodeSocketType.type */
@@ -271,9 +269,7 @@ typedef struct bNode {
/** Used as a boolean for execution. */
uint8_t need_exec;
- char _pad2[5];
- /** #eNodeTreeChangedFlag. */
- uint32_t changed_flag;
+ char _pad2[1];
/** Custom user-defined color. */
float color[3];
@@ -336,25 +332,7 @@ typedef struct bNode {
/** Used at runtime when iterating over node branches. */
char iter_flag;
- /**
- * Describes the desired interface of the node. This is run-time data only.
- * The actual interface of the node may deviate from the declaration temporarily.
- * It's possible to sync the actual state of the node to the desired state. Currently, this is
- * only done when a node is created or loaded.
- *
- * In the future, we may want to keep more data only in the declaration, so that it does not have
- * to be synced to other places that are stored in files. That especially applies to data that
- * can't be edited by users directly (e.g. min/max values of sockets, tooltips, ...).
- *
- * The declaration of a node can be recreated at any time when it is used. Caching it here is
- * just a bit more efficient when it is used a lot. To make sure that the cache is up-to-date,
- * call #nodeDeclarationEnsure before using it.
- *
- * Currently, the declaration is the same for every node of the same type. Going forward, that is
- * intended to change though. Especially when nodes become more dynamic with respect to how many
- * sockets they have.
- */
- NodeDeclarationHandle *declaration;
+ bNodeRuntimeHandle *runtime;
} bNode;
/* node->flag */