Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/NOD_geometry_nodes_log.hh
| Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | |||||
| /** | /** | ||||
| * Logs all data for a specific geometry node tree in a specific context. When the same node group | * Logs all data for a specific geometry node tree in a specific context. When the same node group | ||||
| * is used in multiple times each instantiation will have a separate logger. | * is used in multiple times each instantiation will have a separate logger. | ||||
| */ | */ | ||||
| class GeoTreeLogger { | class GeoTreeLogger { | ||||
| public: | public: | ||||
| std::optional<ComputeContextHash> parent_hash; | std::optional<ComputeContextHash> parent_hash; | ||||
| std::optional<std::string> group_node_name; | std::optional<StringRefNull> group_node_name; | ||||
| Vector<ComputeContextHash> children_hashes; | Vector<ComputeContextHash> children_hashes; | ||||
| LinearAllocator<> *allocator = nullptr; | LinearAllocator<> *allocator = nullptr; | ||||
| struct WarningWithNode { | struct WarningWithNode { | ||||
| std::string node_name; | StringRefNull node_name; | ||||
| NodeWarning warning; | NodeWarning warning; | ||||
| }; | }; | ||||
| struct SocketValueLog { | struct SocketValueLog { | ||||
| std::string node_name; | StringRefNull node_name; | ||||
| std::string socket_identifier; | StringRefNull socket_identifier; | ||||
| destruct_ptr<ValueLog> value; | destruct_ptr<ValueLog> value; | ||||
| }; | }; | ||||
| struct NodeExecutionTime { | struct NodeExecutionTime { | ||||
| std::string node_name; | StringRefNull node_name; | ||||
| TimePoint start; | TimePoint start; | ||||
| TimePoint end; | TimePoint end; | ||||
| }; | }; | ||||
| struct ViewerNodeLogWithNode { | struct ViewerNodeLogWithNode { | ||||
| std::string node_name; | StringRefNull node_name; | ||||
| destruct_ptr<ViewerNodeLog> viewer_log; | destruct_ptr<ViewerNodeLog> viewer_log; | ||||
| }; | }; | ||||
| struct AttributeUsageWithNode { | struct AttributeUsageWithNode { | ||||
| std::string node_name; | StringRefNull node_name; | ||||
| std::string attribute_name; | StringRefNull attribute_name; | ||||
| NamedAttributeUsage usage; | NamedAttributeUsage usage; | ||||
| }; | }; | ||||
| struct DebugMessage { | struct DebugMessage { | ||||
| std::string node_name; | StringRefNull node_name; | ||||
| std::string message; | StringRefNull message; | ||||
| }; | }; | ||||
| Vector<WarningWithNode> node_warnings; | Vector<WarningWithNode> node_warnings; | ||||
| Vector<SocketValueLog> input_socket_values; | Vector<SocketValueLog> input_socket_values; | ||||
| Vector<SocketValueLog> output_socket_values; | Vector<SocketValueLog> output_socket_values; | ||||
| Vector<NodeExecutionTime> node_execution_times; | Vector<NodeExecutionTime> node_execution_times; | ||||
| Vector<ViewerNodeLogWithNode, 0> viewer_node_logs; | Vector<ViewerNodeLogWithNode, 0> viewer_node_logs; | ||||
| Vector<AttributeUsageWithNode, 0> used_named_attributes; | Vector<AttributeUsageWithNode, 0> used_named_attributes; | ||||
| Show All 19 Lines | public: | ||||
| /** Warnings generated for that node. */ | /** Warnings generated for that node. */ | ||||
| Vector<NodeWarning> warnings; | Vector<NodeWarning> warnings; | ||||
| /** | /** | ||||
| * Time spend in that node. For node groups this is the sum of the run times of the nodes | * Time spend in that node. For node groups this is the sum of the run times of the nodes | ||||
| * inside. | * inside. | ||||
| */ | */ | ||||
| std::chrono::nanoseconds run_time{0}; | std::chrono::nanoseconds run_time{0}; | ||||
| /** Maps from socket identifiers to their values. */ | /** Maps from socket identifiers to their values. */ | ||||
| Map<std::string, ValueLog *> input_values_; | Map<StringRefNull, ValueLog *> input_values_; | ||||
| Map<std::string, ValueLog *> output_values_; | Map<StringRefNull, ValueLog *> output_values_; | ||||
| /** Maps from attribute name to their usage flags. */ | /** Maps from attribute name to their usage flags. */ | ||||
| Map<std::string, NamedAttributeUsage> used_named_attributes; | Map<StringRefNull, NamedAttributeUsage> used_named_attributes; | ||||
| /** Messages that are used for debugging purposes during development. */ | /** Messages that are used for debugging purposes during development. */ | ||||
| Vector<std::string> debug_messages; | Vector<StringRefNull> debug_messages; | ||||
| GeoNodeLog(); | GeoNodeLog(); | ||||
| ~GeoNodeLog(); | ~GeoNodeLog(); | ||||
| }; | }; | ||||
| class GeoModifierLog; | class GeoModifierLog; | ||||
| /** | /** | ||||
| Show All 12 Lines | private: | ||||
| bool reduced_node_run_times_ = false; | bool reduced_node_run_times_ = false; | ||||
| bool reduced_socket_values_ = false; | bool reduced_socket_values_ = false; | ||||
| bool reduced_viewer_node_logs_ = false; | bool reduced_viewer_node_logs_ = false; | ||||
| bool reduced_existing_attributes_ = false; | bool reduced_existing_attributes_ = false; | ||||
| bool reduced_used_named_attributes_ = false; | bool reduced_used_named_attributes_ = false; | ||||
| bool reduced_debug_messages_ = false; | bool reduced_debug_messages_ = false; | ||||
| public: | public: | ||||
| Map<std::string, GeoNodeLog> nodes; | Map<StringRefNull, GeoNodeLog> nodes; | ||||
| Map<std::string, ViewerNodeLog *, 0> viewer_node_logs; | Map<StringRefNull, ViewerNodeLog *, 0> viewer_node_logs; | ||||
| Vector<NodeWarning> all_warnings; | Vector<NodeWarning> all_warnings; | ||||
| std::chrono::nanoseconds run_time_sum{0}; | std::chrono::nanoseconds run_time_sum{0}; | ||||
| Vector<const GeometryAttributeInfo *> existing_attributes; | Vector<const GeometryAttributeInfo *> existing_attributes; | ||||
| Map<std::string, NamedAttributeUsage> used_named_attributes; | Map<StringRefNull, NamedAttributeUsage> used_named_attributes; | ||||
| GeoTreeLog(GeoModifierLog *modifier_log, Vector<GeoTreeLogger *> tree_loggers); | GeoTreeLog(GeoModifierLog *modifier_log, Vector<GeoTreeLogger *> tree_loggers); | ||||
| ~GeoTreeLog(); | ~GeoTreeLog(); | ||||
| void ensure_node_warnings(); | void ensure_node_warnings(); | ||||
| void ensure_node_run_time(); | void ensure_node_run_time(); | ||||
| void ensure_socket_values(); | void ensure_socket_values(); | ||||
| void ensure_viewer_node_logs(); | void ensure_viewer_node_logs(); | ||||
| ▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines | |||||