diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-18 18:12:17 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-18 18:12:17 +0300 |
commit | ef2b8c1c3afac9176da936995231523745e21643 (patch) | |
tree | 4e5e4dc2f933a8c759ef707db0593ad9f526a54c /source/blender/nodes/NOD_node_tree_ref.hh | |
parent | 933fed2a17a313f7ef3412eaf911ed6f5944046b (diff) |
Nodes: Remove unnecessary RNA pointer creation
`rna_NodeSocket_refine` and `rna_Node_refine` take significant time
when building the `NodeTreeRef` acceleration data structure, but they
aren't used at all. This commit removes their eager calculation and
instead creates them on-demand in the `rna()` functions. They also
aren't inlined to avoid including `RNA_prototypes.h` in the header.
Differential Revision: https://developer.blender.org/D14674
Diffstat (limited to 'source/blender/nodes/NOD_node_tree_ref.hh')
-rw-r--r-- | source/blender/nodes/NOD_node_tree_ref.hh | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/source/blender/nodes/NOD_node_tree_ref.hh b/source/blender/nodes/NOD_node_tree_ref.hh index 3ed09de8fab..61d1d11d859 100644 --- a/source/blender/nodes/NOD_node_tree_ref.hh +++ b/source/blender/nodes/NOD_node_tree_ref.hh @@ -65,7 +65,6 @@ class SocketRef : NonCopyable, NonMovable { bool is_input_; int id_; int index_; - PointerRNA rna_; Vector<LinkRef *> directly_linked_links_; /* These sockets are linked directly, i.e. with a single link in between. */ @@ -101,7 +100,7 @@ class SocketRef : NonCopyable, NonMovable { const InputSocketRef &as_input() const; const OutputSocketRef &as_output() const; - PointerRNA *rna() const; + PointerRNA rna() const; StringRefNull idname() const; StringRefNull name() const; @@ -152,7 +151,6 @@ class NodeRef : NonCopyable, NonMovable { private: NodeTreeRef *tree_; bNode *bnode_; - PointerRNA rna_; int id_; Vector<InputSocketRef *> inputs_; Vector<OutputSocketRef *> outputs_; @@ -183,7 +181,7 @@ class NodeRef : NonCopyable, NonMovable { bNode *bnode() const; bNodeTree *btree() const; - PointerRNA *rna() const; + PointerRNA rna() const; StringRefNull idname() const; StringRefNull name() const; StringRefNull label() const; @@ -410,11 +408,6 @@ inline const OutputSocketRef &SocketRef::as_output() const return static_cast<const OutputSocketRef &>(*this); } -inline PointerRNA *SocketRef::rna() const -{ - return const_cast<PointerRNA *>(&rna_); -} - inline StringRefNull SocketRef::idname() const { return bsocket_->idname; @@ -571,11 +564,6 @@ inline bNodeTree *NodeRef::btree() const return tree_->btree(); } -inline PointerRNA *NodeRef::rna() const -{ - return const_cast<PointerRNA *>(&rna_); -} - inline StringRefNull NodeRef::idname() const { return bnode_->idname; |