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:
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/DEG_depsgraph.h2
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc44
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc2
-rw-r--r--source/blender/depsgraph/intern/debug/deg_time_average.h11
-rw-r--r--source/blender/depsgraph/intern/depsgraph_query_iter.cc16
-rw-r--r--source/blender/depsgraph/intern/depsgraph_registry.cc2
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_component.cc2
7 files changed, 38 insertions, 41 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index 47dad17b482..aa184cce433 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -82,7 +82,7 @@ extern "C" {
/* CRUD ------------------------------------------- */
-// Get main depsgraph instance from context!
+/* Get main depsgraph instance from context! */
/* Create new Depsgraph instance */
/* TODO: what args are needed here? What's the building-graph entry point? */
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc
index b9ce29ce8d2..bf3af571f0b 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc
@@ -125,13 +125,13 @@ static bool is_reachable(const Node *const from, const Node *const to)
return true;
}
- // Perform a graph walk from 'to' towards its incoming connections.
- // Walking from 'from' towards its outgoing connections is 10x slower on the Spring rig.
+ /* Perform a graph walk from 'to' towards its incoming connections.
+ * Walking from 'from' towards its outgoing connections is 10x slower on the Spring rig. */
deque<const Node *> queue;
Set<const Node *> seen;
queue.push_back(to);
while (!queue.empty()) {
- // Visit the next node to inspect.
+ /* Visit the next node to inspect. */
const Node *visit = queue.back();
queue.pop_back();
@@ -139,7 +139,7 @@ static bool is_reachable(const Node *const from, const Node *const to)
return true;
}
- // Queue all incoming relations that we haven't seen before.
+ /* Queue all incoming relations that we haven't seen before. */
for (Relation *relation : visit->inlinks) {
const Node *prev_node = relation->from;
if (seen.add(prev_node)) {
@@ -177,7 +177,7 @@ void DepsgraphRelationBuilder::build_driver_relations(IDNode *id_node)
return;
}
- // Mapping from RNA prefix -> set of driver descriptors:
+ /* Mapping from RNA prefix -> set of driver descriptors: */
Map<string, Vector<DriverDescriptor>> driver_groups;
PointerRNA id_ptr;
@@ -197,47 +197,47 @@ void DepsgraphRelationBuilder::build_driver_relations(IDNode *id_node)
}
for (Span<DriverDescriptor> prefix_group : driver_groups.values()) {
- // For each node in the driver group, try to connect it to another node
- // in the same group without creating any cycles.
+ /* For each node in the driver group, try to connect it to another node
+ * in the same group without creating any cycles. */
int num_drivers = prefix_group.size();
if (num_drivers < 2) {
- // A relation requires two drivers.
+ /* A relation requires two drivers. */
continue;
}
for (int from_index = 0; from_index < num_drivers; ++from_index) {
const DriverDescriptor &driver_from = prefix_group[from_index];
Node *op_from = get_node(driver_from.depsgraph_key());
- // Start by trying the next node in the group.
+ /* Start by trying the next node in the group. */
for (int to_offset = 1; to_offset < num_drivers; ++to_offset) {
const int to_index = (from_index + to_offset) % num_drivers;
const DriverDescriptor &driver_to = prefix_group[to_index];
Node *op_to = get_node(driver_to.depsgraph_key());
- // Duplicate drivers can exist (see T78615), but cannot be distinguished by OperationKey
- // and thus have the same depsgraph node. Relations between those drivers should not be
- // created. This not something that is expected to happen (both the UI and the Python API
- // prevent duplicate drivers), it did happen in a file and it is easy to deal with here.
+ /* Duplicate drivers can exist (see T78615), but cannot be distinguished by OperationKey
+ * and thus have the same depsgraph node. Relations between those drivers should not be
+ * created. This not something that is expected to happen (both the UI and the Python API
+ * prevent duplicate drivers), it did happen in a file and it is easy to deal with here. */
if (op_from == op_to) {
continue;
}
if (from_index < to_index && driver_from.is_same_array_as(driver_to)) {
- // This is for adding a relation like `color[0]` -> `color[1]`.
- // When the search for another driver wraps around, we cannot blindly add relations any
- // more.
+ /* This is for adding a relation like `color[0]` -> `color[1]`.
+ * When the search for another driver wraps around,
+ * we cannot blindly add relations any more. */
}
else {
- // Investigate whether this relation would create a dependency cycle.
- // Example graph:
- // A -> B -> C
- // and investigating a potential connection C->A. Because A->C is an
- // existing transitive connection, adding C->A would create a cycle.
+ /* Investigate whether this relation would create a dependency cycle.
+ * Example graph:
+ * A -> B -> C
+ * and investigating a potential connection C->A. Because A->C is an
+ * existing transitive connection, adding C->A would create a cycle. */
if (is_reachable(op_to, op_from)) {
continue;
}
- // No need to directly connect this node if there is already a transitive connection.
+ /* No need to directly connect this node if there is already a transitive connection. */
if (is_reachable(op_from, op_to)) {
break;
}
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc
index e0a7a42ea4a..bad4e96c60b 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc
@@ -28,7 +28,7 @@
namespace blender::deg {
////////////////////////////////////////////////////////////////////////////////
-// Time source.
+/* Time source. */
TimeSourceKey::TimeSourceKey() : id(nullptr)
{
diff --git a/source/blender/depsgraph/intern/debug/deg_time_average.h b/source/blender/depsgraph/intern/debug/deg_time_average.h
index 838ceff8d96..4ed78fe70cb 100644
--- a/source/blender/depsgraph/intern/debug/deg_time_average.h
+++ b/source/blender/depsgraph/intern/debug/deg_time_average.h
@@ -26,8 +26,7 @@
namespace blender {
namespace deg {
-// Utility class which takes care of calculating average of time series, such as
-// FPS counters.
+/* Utility class which takes care of calculating average of time series, such as FPS counters. */
template<int MaxSamples> class AveragedTimeSampler {
public:
AveragedTimeSampler() : num_samples_(0), next_sample_index_(0)
@@ -38,13 +37,13 @@ template<int MaxSamples> class AveragedTimeSampler {
{
samples_[next_sample_index_] = value;
- // Move to the next index, keeping wrapping at the end of array into account.
+ /* Move to the next index, keeping wrapping at the end of array into account. */
++next_sample_index_;
if (next_sample_index_ == MaxSamples) {
next_sample_index_ = 0;
}
- // Update number of stored samples.
+ /* Update number of stored samples. */
if (num_samples_ != MaxSamples) {
++num_samples_;
}
@@ -62,10 +61,10 @@ template<int MaxSamples> class AveragedTimeSampler {
protected:
double samples_[MaxSamples];
- // Number of samples which are actually stored in the array.
+ /* Number of samples which are actually stored in the array. */
int num_samples_;
- // Index in the samples_ array under which next sample will be stored.
+ /* Index in the samples_ array under which next sample will be stored. */
int next_sample_index_;
};
diff --git a/source/blender/depsgraph/intern/depsgraph_query_iter.cc b/source/blender/depsgraph/intern/depsgraph_query_iter.cc
index df1cf8cc771..770d9775dd3 100644
--- a/source/blender/depsgraph/intern/depsgraph_query_iter.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query_iter.cc
@@ -51,9 +51,9 @@
# include "intern/eval/deg_eval_copy_on_write.h"
#endif
-// If defined, all working data will be set to an invalid state, helping
-// to catch issues when areas accessing data which is considered to be no
-// longer available.
+/* If defined, all working data will be set to an invalid state, helping
+ * to catch issues when areas accessing data which is considered to be no
+ * longer available. */
#undef INVALIDATE_WORK_DATA
#ifndef NDEBUG
@@ -79,22 +79,20 @@ void deg_invalidate_iterator_work_data(DEGObjectIterData *data)
void verify_id_properties_freed(DEGObjectIterData *data)
{
if (data->dupli_object_current == nullptr) {
- // We didn't enter duplication yet, so we can't have any dangling
- // pointers.
+ /* We didn't enter duplication yet, so we can't have any dangling pointers. */
return;
}
const Object *dupli_object = data->dupli_object_current->ob;
Object *temp_dupli_object = &data->temp_dupli_object;
if (temp_dupli_object->id.properties == nullptr) {
- // No ID properties in temp data-block -- no leak is possible.
+ /* No ID properties in temp data-block -- no leak is possible. */
return;
}
if (temp_dupli_object->id.properties == dupli_object->id.properties) {
- // Temp copy of object did not modify ID properties.
+ /* Temp copy of object did not modify ID properties. */
return;
}
- // Free memory which is owned by temporary storage which is about to
- // get overwritten.
+ /* Free memory which is owned by temporary storage which is about to get overwritten. */
IDP_FreeProperty(temp_dupli_object->id.properties);
temp_dupli_object->id.properties = nullptr;
}
diff --git a/source/blender/depsgraph/intern/depsgraph_registry.cc b/source/blender/depsgraph/intern/depsgraph_registry.cc
index f348ef6e6e9..cc9fcf78292 100644
--- a/source/blender/depsgraph/intern/depsgraph_registry.cc
+++ b/source/blender/depsgraph/intern/depsgraph_registry.cc
@@ -49,7 +49,7 @@ void unregister_graph(Depsgraph *depsgraph)
VectorSet<Depsgraph *> &graphs = graph_registry.lookup(bmain);
graphs.remove(depsgraph);
- // If this was the last depsgraph associated with the main, remove the main entry as well.
+ /* If this was the last depsgraph associated with the main, remove the main entry as well. */
if (graphs.is_empty()) {
graph_registry.remove(bmain);
}
diff --git a/source/blender/depsgraph/intern/node/deg_node_component.cc b/source/blender/depsgraph/intern/node/deg_node_component.cc
index 431bf536b65..a29618cefa8 100644
--- a/source/blender/depsgraph/intern/node/deg_node_component.cc
+++ b/source/blender/depsgraph/intern/node/deg_node_component.cc
@@ -237,7 +237,7 @@ void ComponentNode::tag_update(Depsgraph *graph, eUpdateSource source)
for (OperationNode *op_node : operations) {
op_node->tag_update(graph, source);
}
- // It is possible that tag happens before finalization.
+ /* It is possible that tag happens before finalization. */
if (operations_map != nullptr) {
for (OperationNode *op_node : operations_map->values()) {
op_node->tag_update(graph, source);