Fix T38487: Wrapped translate node in combination with other buffered

nodes (Blur) causes crash due to chained read/write buffer operations.

The way read/write buffer operations are created for both the wrapped
translate node and then the "complex" blur node creates a chain of
buffers in the same ExecutionGroup. This leaves the later write buffer
operations without a proper "executor" group and fails on assert.

Solution for now is to check for existing output buffer operations like
it already happens for inputs. This is extremely ugly code, but should
become a lot more transparent after compositor cleanup ({D309}).
This commit is contained in:
Lukas Tönne 2014-02-17 10:48:54 +01:00
parent dbd37b21bd
commit 7ee9de29a6
Notes: blender-bot 2023-07-10 10:12:37 +02:00
Referenced by issue #38487, Blur + Wrapped Translate = Crash
1 changed files with 27 additions and 7 deletions

View File

@ -241,14 +241,34 @@ void ExecutionSystem::addReadWriteBufferOperations(NodeOperation *operation)
*/
OutputSocket *outputsocket = operation->getOutputSocket();
if (outputsocket->isConnected()) {
WriteBufferOperation *writeOperation;
writeOperation = new WriteBufferOperation();
writeOperation->setbNodeTree(this->getContext().getbNodeTree());
this->addOperation(writeOperation);
ExecutionSystemHelper::addLink(this->getConnections(), outputsocket, writeOperation->getInputSocket(0));
writeOperation->readResolutionFromInputSocket();
for (index = 0; index < outputsocket->getNumberOfConnections() - 1; index++) {
WriteBufferOperation *writeOperation = NULL;
/* try to find existing write buffer operation first */
for (index = 0; index < outputsocket->getNumberOfConnections(); index++) {
SocketConnection *connection = outputsocket->getConnection(index);
NodeBase *otherEnd = connection->getToNode();
if (otherEnd->isOperation()) {
NodeOperation *otherEndOp = (NodeOperation *)otherEnd;
if (otherEndOp->isWriteBufferOperation()) {
writeOperation = (WriteBufferOperation *)otherEndOp;
break;
}
}
}
/* if no write buffer operation exists yet, create a new one */
if (!writeOperation) {
writeOperation = new WriteBufferOperation();
writeOperation->setbNodeTree(this->getContext().getbNodeTree());
this->addOperation(writeOperation);
ExecutionSystemHelper::addLink(this->getConnections(), outputsocket, writeOperation->getInputSocket(0));
}
writeOperation->readResolutionFromInputSocket();
for (index = 0; index < outputsocket->getNumberOfConnections(); index++) {
SocketConnection *connection = outputsocket->getConnection(index);
/* skip existing connections to write buffer operation */
if (connection->getToNode() == writeOperation)
continue;
ReadBufferOperation *readoperation = new ReadBufferOperation();
readoperation->setMemoryProxy(writeOperation->getMemoryProxy());
connection->setFromSocket(readoperation->getOutputSocket());