diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index c46b1c20738..104c1500756 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -252,6 +252,7 @@ class NODE_PT_quality(bpy.types.Panel): col = layout.column() col.prop(tree, "use_opencl") + col.prop(tree, "use_groupnode_buffer") col.prop(tree, "two_pass") col.prop(snode, "show_highlight") col.prop(snode, "use_hidden_preview") diff --git a/source/blender/compositor/intern/COM_CompositorContext.h b/source/blender/compositor/intern/COM_CompositorContext.h index 2f5e8c0648d..840a9e59584 100644 --- a/source/blender/compositor/intern/COM_CompositorContext.h +++ b/source/blender/compositor/intern/COM_CompositorContext.h @@ -74,7 +74,7 @@ private: * @brief does this system have active opencl devices? */ bool m_hasActiveOpenCLDevices; - + /** * @brief Skip slow nodes */ @@ -178,6 +178,7 @@ public: void setFastCalculation(bool fastCalculation) {this->m_fastCalculation = fastCalculation;} bool isFastCalculation() {return this->m_fastCalculation;} + inline bool isGroupnodeBufferEnabled() {return this->getbNodeTree()->flag & NTREE_COM_GROUPNODE_BUFFER;} }; diff --git a/source/blender/compositor/nodes/COM_GroupNode.cpp b/source/blender/compositor/nodes/COM_GroupNode.cpp index 4cef337d994..05c749345d5 100644 --- a/source/blender/compositor/nodes/COM_GroupNode.cpp +++ b/source/blender/compositor/nodes/COM_GroupNode.cpp @@ -64,11 +64,12 @@ void GroupNode::ungroup(ExecutionSystem &system) } } + const bool groupnodeBuffering = system.getContext().isGroupnodeBufferEnabled(); for (index = 0; index < outputsockets.size(); index++) { OutputSocket *outputSocket = outputsockets[index]; bNodeSocket *editorOutput = outputSocket->getbNodeSocket(); if (editorOutput->groupsock) { - SocketProxyNode *proxy = new SocketProxyNode(bnode, editorOutput->groupsock, editorOutput, true); + SocketProxyNode *proxy = new SocketProxyNode(bnode, editorOutput->groupsock, editorOutput, groupnodeBuffering); outputSocket->relinkConnections(proxy->getOutputSocket(0)); ExecutionSystemHelper::addNode(system.getNodes(), proxy); } diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 7f2e388cd69..5aaf46a541f 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -309,9 +309,11 @@ typedef struct bNodeTree { #define NTREE_TYPE_INIT 1 /* ntree->flag */ -#define NTREE_DS_EXPAND 1 /* for animation editors */ -#define NTREE_COM_OPENCL 2 /* use opencl */ -#define NTREE_TWO_PASS 4 /* two pass */ +#define NTREE_DS_EXPAND 1 /* for animation editors */ +#define NTREE_COM_OPENCL 2 /* use opencl */ +#define NTREE_TWO_PASS 4 /* two pass */ +#define NTREE_COM_GROUPNODE_BUFFER 8 /* use groupnode buffers */ + /* XXX not nice, but needed as a temporary flags * for group updates after library linking. */ diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 397e05b6a97..2140f90664e 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -4971,6 +4971,10 @@ static void rna_def_composite_nodetree(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", NTREE_COM_OPENCL); RNA_def_property_ui_text(prop, "OpenCL", "Enable GPU calculations"); + prop = RNA_def_property(srna, "use_groupnode_buffer", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NTREE_COM_GROUPNODE_BUFFER); + RNA_def_property_ui_text(prop, "Buffer Groups", "Enable buffering of group nodes"); + prop = RNA_def_property(srna, "two_pass", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NTREE_TWO_PASS); RNA_def_property_ui_text(prop, "Two Pass", "Use two pass execution during editing: first calculate fast nodes, "