From f517b3a29568fd43b722973c7c46d3c358ba0dda Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Wed, 18 May 2022 16:42:49 +0200 Subject: Fix T98157: improve animation fps with better check in depsgraph Previously, the depsgraph assumed that every node tree might contain a reference to a video. This resulted noticeable overhead when there was no video. Checking whether a node tree contained a video was relatively expensive to do in the depsgraph. It is cheaper now due to the structure of the new node tree updater. This also adds an additional run-time field to `bNodeTree` (there are quite a few already). We should move those to a separate run-time struct, but not as part of a bug fix. Differential Revision: https://developer.blender.org/D14957 --- source/blender/makesdna/DNA_node_types.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna/DNA_node_types.h') diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index d18fe1b81dd..b66fe31c00e 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -499,7 +499,13 @@ typedef struct bNodeTree { int type; - char _pad1[4]; + /** + * Used to cache run-time information of the node tree. + * #eNodeTreeRuntimeFlag. + */ + uint8_t runtime_flag; + + char _pad1[3]; /** * Sockets in groups have unique identifiers, adding new sockets always @@ -601,6 +607,11 @@ typedef enum eNodeTreeExecutionMode { NTREE_EXECUTION_MODE_FULL_FRAME = 1, } eNodeTreeExecutionMode; +typedef enum eNodeTreeRuntimeFlag { + /** There is a node that references an image with animation. */ + NTREE_RUNTIME_FLAG_HAS_IMAGE_ANIMATION = 1 << 0, +} eNodeTreeRuntimeFlag; + /* socket value structs for input buttons * DEPRECATED now using ID properties */ -- cgit v1.2.3