Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-04-02 16:24:34 +0300
committerJeroen Bakker <jeroen@blender.org>2021-04-02 16:24:34 +0300
commita0f705f18c49d98bdad55eeb8d52ba48c86f4fc9 (patch)
tree3cfbc964fc06165bca0e214be6521f3dd1d02ed3 /source/blender/compositor/intern/COM_NodeOperation.cc
parentfa9b05149c2ca3915a4fb2670c87a648d927336c (diff)
Compositor: Debug stream operator.
Stream operators for NodeOperator and ExecutionGroup to help during debugging.
Diffstat (limited to 'source/blender/compositor/intern/COM_NodeOperation.cc')
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.cc69
1 files changed, 69 insertions, 0 deletions
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cc b/source/blender/compositor/intern/COM_NodeOperation.cc
index 297ef100a1b..6c60a858b6c 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.cc
+++ b/source/blender/compositor/intern/COM_NodeOperation.cc
@@ -20,6 +20,7 @@
#include <typeinfo>
#include "COM_ExecutionSystem.h"
+#include "COM_ReadBufferOperation.h"
#include "COM_defines.h"
#include "COM_NodeOperation.h" /* own include */
@@ -209,4 +210,72 @@ 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(";
+ if (!node_operation.get_name().empty()) {
+ os << "name=" << node_operation.get_name() << ",";
+ }
+ 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