Added option for group node buffering in the compositor.
authorMonique Dewanchand <m.dewanchand@atmind.nl>
Sat, 16 Feb 2013 20:21:41 +0000 (20:21 +0000)
committerMonique Dewanchand <m.dewanchand@atmind.nl>
Sat, 16 Feb 2013 20:21:41 +0000 (20:21 +0000)
Justa cluster did not have enough memory to handle all Mango 4k scenes.
Option is default disabled and can be enabled in the performance panel.

 - At Mind -

release/scripts/startup/bl_ui/space_node.py
source/blender/compositor/intern/COM_CompositorContext.h
source/blender/compositor/nodes/COM_GroupNode.cpp
source/blender/makesdna/DNA_node_types.h
source/blender/makesrna/intern/rna_nodetree.c

index c46b1c20738f55a6d6f5b111c22810ee86709349..104c15007568cc8c52ae7d61c2e176fbd9b29d23 100644 (file)
@@ -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")
index 2f5e8c0648d58337fbad18785364cc4a03e109cb..840a9e595846220f523b4ec401587378e3c15c98 100644 (file)
@@ -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;}
 };
 
 
index 4cef337d9949e48612488fbaac40ddbc095e4979..05c749345d59dcce6c0ec36a20df2821cb490ea9 100644 (file)
@@ -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);
                }
index 7f2e388cd69d923a025eed89d975f70503171ba3..5aaf46a541f1bed6586c6f22481ad2be31304f6d 100644 (file)
@@ -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.
  */
index 397e05b6a97ba1cd35ba138350e1bc2a4254b002..2140f90664ef4b9328d190563fbc5da9b8a42520 100644 (file)
@@ -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, "