[Bf-blender-cvs] [a0dc9e28ae2] temp-compositor-single-threaded-operation: Compositor: Added debugging tools.
Jeroen Bakker
noreply at git.blender.org
Fri Apr 2 11:29:18 CEST 2021
Commit: a0dc9e28ae291a4e51e3fc703dc5541512da1b3a
Author: Jeroen Bakker
Date: Fri Apr 2 11:28:51 2021 +0200
Branches: temp-compositor-single-threaded-operation
https://developer.blender.org/rBa0dc9e28ae291a4e51e3fc703dc5541512da1b3a
Compositor: Added debugging tools.
===================================================================
M source/blender/compositor/intern/COM_ExecutionGroup.cc
M source/blender/compositor/intern/COM_ExecutionSystem.cc
M source/blender/compositor/intern/COM_MemoryProxy.h
M source/blender/compositor/intern/COM_NodeOperation.cc
M source/blender/compositor/intern/COM_NodeOperation.h
M source/blender/compositor/operations/COM_ReadBufferOperation.h
===================================================================
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cc b/source/blender/compositor/intern/COM_ExecutionGroup.cc
index b6e4cef7448..d24de869be3 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.cc
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.cc
@@ -91,8 +91,10 @@ ExecutionGroup::ExecutionGroup(int id)
std::ostream &operator<<(std::ostream &os, const ExecutionGroup &execution_group)
{
- os << "ExecutionGroup(id=" << execution_group.get_id()
- << ",flags=" << execution_group.get_flags() << ")";
+ os << "ExecutionGroup(id=" << execution_group.get_id();
+ os << ",flags={" << execution_group.get_flags() << "}";
+ os << ",operation=" << *execution_group.getOutputOperation() << "";
+ os << ")";
return os;
}
diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cc b/source/blender/compositor/intern/COM_ExecutionSystem.cc
index cb2c05c5217..4203ff16930 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystem.cc
+++ b/source/blender/compositor/intern/COM_ExecutionSystem.cc
@@ -191,6 +191,7 @@ static void link_work_packages(blender::Vector<ExecutionGroup *> &groups)
group->getOutputOperation()->determineDependingAreaOfInterest(
&work_package.rect, read_operation, &area);
ExecutionGroup *parent = read_operation->getMemoryProxy()->getExecutor();
+ std::cout << *group << "->" << *parent << "\n";
parent->link_child_work_packages(&work_package, &area);
}
}
diff --git a/source/blender/compositor/intern/COM_MemoryProxy.h b/source/blender/compositor/intern/COM_MemoryProxy.h
index 0966eadadb2..ddbca7e3adb 100644
--- a/source/blender/compositor/intern/COM_MemoryProxy.h
+++ b/source/blender/compositor/intern/COM_MemoryProxy.h
@@ -88,7 +88,7 @@ class MemoryProxy {
* \brief get the WriteBufferOperation that is responsible for writing to this MemoryProxy
* \return WriteBufferOperation
*/
- WriteBufferOperation *getWriteBufferOperation()
+ WriteBufferOperation *getWriteBufferOperation() const
{
return this->m_writeBufferOperation;
}
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cc b/source/blender/compositor/intern/COM_NodeOperation.cc
index 297ef100a1b..d91b9eac210 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.cc
+++ b/source/blender/compositor/intern/COM_NodeOperation.cc
@@ -23,6 +23,7 @@
#include "COM_defines.h"
#include "COM_NodeOperation.h" /* own include */
+#include "COM_ReadBufferOperation.h"
namespace blender::compositor {
@@ -209,4 +210,68 @@ void NodeOperationOutput::determineResolution(unsigned int resolution[2],
}
}
+std::ostream &operator<<(std::ostream &os, const NodeOperationFlags &node_operation_flags)
+{
+ if (node_operation_flags.complex) {
+ os << "complex,";
+ }
+ if (node_operation_flags.open_cl) {
+ os << "open_cl,";
+ }
+ if (node_operation_flags.single_threaded) {
+ os << "single_threaded,";
+ }
+ if (node_operation_flags.use_render_border) {
+ os << "render_border,";
+ }
+ if (node_operation_flags.use_viewer_border) {
+ os << "view_border,";
+ }
+ if (node_operation_flags.is_resolution_set) {
+ os << "resolution_set,";
+ }
+ if (node_operation_flags.is_set_operation) {
+ os << "set_operation,";
+ }
+ if (node_operation_flags.is_write_buffer_operation) {
+ os << "write_buffer,";
+ }
+ if (node_operation_flags.is_read_buffer_operation) {
+ os << "read_buffer,";
+ }
+ if (node_operation_flags.is_proxy_operation) {
+ os << "proxy,";
+ }
+ if (node_operation_flags.is_viewer_operation) {
+ os << "viewer,";
+ }
+ if (node_operation_flags.is_preview_operation) {
+ os << "preview,";
+ }
+ if (!node_operation_flags.use_datatype_conversion) {
+ os << "no_conversion,";
+ }
+
+ return os;
+}
+
+std::ostream &operator<<(std::ostream &os, const NodeOperation &node_operation)
+{
+ NodeOperationFlags flags = node_operation.get_flags();
+ os << "NodeOperation(";
+ os << "flags={" << flags << "},";
+ if (flags.is_read_buffer_operation) {
+ const ReadBufferOperation *read_operation = (const ReadBufferOperation *)&node_operation;
+ const MemoryProxy *proxy = read_operation->getMemoryProxy();
+ if (proxy) {
+ const WriteBufferOperation *write_operation = proxy->getWriteBufferOperation();
+ if (write_operation) {
+ os << "write=" << (NodeOperation &)*write_operation << ",";
+ }
+ }
+ }
+ os << ")";
+
+ return os;
+}
} // namespace blender::compositor
diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h
index f300fb092a3..ac47d62d146 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.h
+++ b/source/blender/compositor/intern/COM_NodeOperation.h
@@ -594,4 +594,7 @@ class NodeOperation {
#endif
};
+std::ostream &operator<<(std::ostream &os, const NodeOperationFlags &node_operation_flags);
+std::ostream &operator<<(std::ostream &os, const NodeOperation &node_operation);
+
} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.h b/source/blender/compositor/operations/COM_ReadBufferOperation.h
index 981c09292af..b0e5262a34c 100644
--- a/source/blender/compositor/operations/COM_ReadBufferOperation.h
+++ b/source/blender/compositor/operations/COM_ReadBufferOperation.h
@@ -37,7 +37,7 @@ class ReadBufferOperation : public NodeOperation {
{
this->m_memoryProxy = memoryProxy;
}
- MemoryProxy *getMemoryProxy()
+ MemoryProxy *getMemoryProxy() const
{
return this->m_memoryProxy;
}
More information about the Bf-blender-cvs
mailing list