Cleanup and improvements of the compositor debug output.

Debug code for graphviz output moved to a dedicated file COM_Debug.h/cpp.

The DebugInfo class has only static functions, which are called from a number of places to keep track of what is happening in the compositor. If debugging is disabled these are just inline stubs, so we
don't need #ifdefs everywhere and don't get any overhead.

The graphviz output is much more useful now. DebugInfo keeps track of node names in a static string map for meaningful names. It uses a number of colors for various special operation classes.
ExecutionGroups are indicated in graphviz with clusters.

Currently the graphviz .dot files are stored in the BLI_temporary_dir() folder. A separate dot file is generated for each stage of the ExecutionGroup scheduling, this is intended to give some idea of the
compositor progress, but could still be improved.
This commit is contained in:
Lukas Toenne
2013-09-13 13:36:47 +00:00
parent ed2343270c
commit fdd8897172
14 changed files with 522 additions and 162 deletions

View File

@@ -22,8 +22,6 @@
#include "COM_ExecutionSystem.h"
#include <sstream>
#include "PIL_time.h"
#include "BLI_utildefines.h"
extern "C" {
@@ -40,6 +38,7 @@ extern "C" {
#include "COM_WriteBufferOperation.h"
#include "COM_ReadBufferOperation.h"
#include "COM_ExecutionSystemHelper.h"
#include "COM_Debug.h"
#include "BKE_global.h"
@@ -101,9 +100,7 @@ ExecutionSystem::ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool re
}
}
#ifdef COM_DEBUG
ExecutionSystemHelper::debugDump(this);
#endif
// DebugInfo::graphviz(this);
}
ExecutionSystem::~ExecutionSystem()
@@ -133,6 +130,8 @@ ExecutionSystem::~ExecutionSystem()
void ExecutionSystem::execute()
{
DebugInfo::execute_started(this);
unsigned int order = 0;
for (vector<NodeOperation *>::iterator iter = this->m_operations.begin(); iter != this->m_operations.end(); ++iter) {
NodeBase *node = *iter;
@@ -199,11 +198,13 @@ void ExecutionSystem::executeGroups(CompositorPriority priority)
void ExecutionSystem::addOperation(NodeOperation *operation)
{
ExecutionSystemHelper::addOperation(this->m_operations, operation);
// operation->setBTree
DebugInfo::operation_added(operation);
}
void ExecutionSystem::addReadWriteBufferOperations(NodeOperation *operation)
{
DebugInfo::operation_read_write_buffer(operation);
// for every input add write and read operation if input is not a read operation
// only add read operation to other links when they are attached to buffered operations.
unsigned int index;
@@ -283,8 +284,10 @@ static void debug_check_node_connections(Node *node)
void ExecutionSystem::convertToOperations()
{
unsigned int index;
for (index = 0; index < this->m_nodes.size(); index++) {
Node *node = (Node *)this->m_nodes[index];
DebugInfo::node_to_operations(node);
node->convertToOperations(this, &this->m_context);
debug_check_node_connections(node);