diff options
author | Monique Dewanchand <m.dewanchand@atmind.nl> | 2013-02-03 21:22:26 +0400 |
---|---|---|
committer | Monique Dewanchand <m.dewanchand@atmind.nl> | 2013-02-03 21:22:26 +0400 |
commit | 2950214527812503b009995c638d2be37efaa22f (patch) | |
tree | fb56d981200952a73f1ffa24e8ad09380e84d398 /source/blender/compositor/nodes/COM_SocketProxyNode.cpp | |
parent | b58b107db409c877b523f90ff8feb5c4db7688a8 (diff) |
One fix for bug [#33785] compositor is (unnecessarily?) slow
Added additional buffers - new subtree - for groupnodes.
One needs to be aware of how groupnodes should be created.
Having translate & scale nodes, with the translate inside the groupnode and the scale node outside, causes artefacts.
Both should be inside or outside the groupnode. Same holds for other distort nodes.
Diffstat (limited to 'source/blender/compositor/nodes/COM_SocketProxyNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_SocketProxyNode.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/compositor/nodes/COM_SocketProxyNode.cpp b/source/blender/compositor/nodes/COM_SocketProxyNode.cpp index bfb32a96156..e6026675d20 100644 --- a/source/blender/compositor/nodes/COM_SocketProxyNode.cpp +++ b/source/blender/compositor/nodes/COM_SocketProxyNode.cpp @@ -27,11 +27,14 @@ #include "COM_SetValueOperation.h" #include "COM_SetVectorOperation.h" #include "COM_SetColorOperation.h" +#include "COM_WriteBufferOperation.h" +#include "COM_ReadBufferOperation.h" -SocketProxyNode::SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput) : Node(editorNode, false) +SocketProxyNode::SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput, bool buffer) : Node(editorNode, false) { DataType dt; - + this->m_buffer = buffer; + dt = COM_DT_VALUE; if (editorInput->type == SOCK_RGBA) dt = COM_DT_COLOR; if (editorInput->type == SOCK_VECTOR) dt = COM_DT_VECTOR; @@ -49,11 +52,22 @@ void SocketProxyNode::convertToOperations(ExecutionSystem *graph, CompositorCont InputSocket *inputsocket = this->getInputSocket(0); if (outputsocket->isConnected()) { if (inputsocket->isConnected()) { - SocketProxyOperation *operation = new SocketProxyOperation(this->getOutputSocket()->getDataType()); + SocketProxyOperation *operation = new SocketProxyOperation(this->getOutputSocket()->getDataType()); inputsocket->relinkConnections(operation->getInputSocket(0)); outputsocket->relinkConnections(operation->getOutputSocket(0)); graph->addOperation(operation); - } + if (m_buffer){ + WriteBufferOperation * writeOperation = new WriteBufferOperation(); + ReadBufferOperation * readOperation = new ReadBufferOperation(); + readOperation->setMemoryProxy(writeOperation->getMemoryProxy()); + + operation->getOutputSocket()->relinkConnections(readOperation->getOutputSocket()); + addLink(graph, operation->getOutputSocket(), writeOperation->getInputSocket(0)); + + graph->addOperation(writeOperation); + graph->addOperation(readOperation); + } + } else { /* If input is not connected, add a constant value operation instead */ switch (outputsocket->getDataType()) { |