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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-07-26 11:38:13 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-07-26 11:45:07 +0300
commit40a0fa8a8f1299e614ecaf6c271ef5a7fa02ee46 (patch)
tree4a72f84fc62375cb34747254e7f020d5e2ca53c7
parenteececb0d8036bfcf048a3f1e47e8033e21bf86a9 (diff)
Depsgraph: Use proper unsigned int bitfield for layers flags
-rw-r--r--source/blender/depsgraph/DEG_depsgraph.h4
-rw-r--r--source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc4
-rw-r--r--source/blender/depsgraph/intern/depsgraph.h2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_eval.cc2
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval.cc22
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval.h2
-rw-r--r--source/blender/depsgraph/intern/nodes/deg_node.h2
-rw-r--r--source/blender/depsgraph/intern/nodes/deg_node_component.cc2
-rw-r--r--source/blender/depsgraph/intern/nodes/deg_node_component.h2
9 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index d1de83ec8a9..945a4785b9c 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -168,7 +168,7 @@ void DEG_evaluate_on_framechange(struct EvaluationContext *eval_ctx,
struct Main *bmain,
Depsgraph *graph,
float ctime,
- const int layer);
+ const unsigned int layer);
/* Data changed recalculation entry point.
* < context_type: context to perform evaluation for
@@ -176,7 +176,7 @@ void DEG_evaluate_on_framechange(struct EvaluationContext *eval_ctx,
*/
void DEG_evaluate_on_refresh_ex(struct EvaluationContext *eval_ctx,
Depsgraph *graph,
- const int layers);
+ const unsigned int layers);
/* Data changed recalculation entry point.
* < context_type: context to perform evaluation for
diff --git a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
index 5ce84ee29db..9088e3bf403 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
@@ -288,7 +288,7 @@ static void deg_debug_graphviz_node_single(const DebugContext &ctx,
if (node->type == DEPSNODE_TYPE_ID_REF) {
IDDepsNode *id_node = (IDDepsNode *)node;
char buf[256];
- BLI_snprintf(buf, sizeof(buf), " (Layers: %d)", id_node->layers);
+ BLI_snprintf(buf, sizeof(buf), " (Layers: %u)", id_node->layers);
name += buf;
}
if (ctx.show_eval_priority && node->tclass == DEPSNODE_CLASS_OPERATION) {
@@ -324,7 +324,7 @@ static void deg_debug_graphviz_node_cluster_begin(const DebugContext &ctx,
if (node->type == DEPSNODE_TYPE_ID_REF) {
IDDepsNode *id_node = (IDDepsNode *)node;
char buf[256];
- BLI_snprintf(buf, sizeof(buf), " (Layers: %d)", id_node->layers);
+ BLI_snprintf(buf, sizeof(buf), " (Layers: %u)", id_node->layers);
name += buf;
}
deg_debug_fprintf(ctx, "// %s\n", name.c_str());
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index 213bb304d73..08b264f8497 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -191,7 +191,7 @@ struct Depsgraph {
/* Layers Visibility .................. */
/* Visible layers bitfield, used for skipping invisible objects updates. */
- int layers;
+ unsigned int layers;
// XXX: additional stuff like eval contexts, mempools for allocating nodes from, etc.
};
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc
index f8d40d0e6a8..a0435c318f0 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cc
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cc
@@ -133,7 +133,7 @@ void DEG_evaluate_on_framechange(EvaluationContext *eval_ctx,
Main *bmain,
Depsgraph *graph,
float ctime,
- const int layers)
+ const unsigned int layers)
{
DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph);
/* Update time on primary timesource. */
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc
index 3024d625846..c3fd202d832 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval.cc
@@ -72,13 +72,13 @@ namespace DEG {
static void schedule_children(TaskPool *pool,
Depsgraph *graph,
OperationDepsNode *node,
- const int layers,
+ const unsigned int layers,
const int thread_id);
struct DepsgraphEvalState {
EvaluationContext *eval_ctx;
Depsgraph *graph;
- int layers;
+ unsigned int layers;
};
static void deg_task_run_func(TaskPool *pool,
@@ -140,7 +140,7 @@ static void deg_task_run_func(TaskPool *pool,
OperationDepsNode *child = (OperationDepsNode *)rel->to;
BLI_assert(child->type == DEPSNODE_TYPE_OPERATION);
if (!child->scheduled) {
- int id_layers = child->owner->owner->layers;
+ unsigned int id_layers = child->owner->owner->layers;
if (!((child->flag & DEPSOP_FLAG_NEEDS_UPDATE) != 0 &&
(id_layers & state->layers) != 0))
{
@@ -197,14 +197,14 @@ static void deg_task_run_func(TaskPool *pool,
typedef struct CalculatePengindData {
Depsgraph *graph;
- int layers;
+ unsigned int layers;
} CalculatePengindData;
static void calculate_pending_func(void *data_v, int i)
{
CalculatePengindData *data = (CalculatePengindData *)data_v;
Depsgraph *graph = data->graph;
- int layers = data->layers;
+ unsigned int layers = data->layers;
OperationDepsNode *node = graph->operations[i];
IDDepsNode *id_node = node->owner->owner;
@@ -231,7 +231,7 @@ static void calculate_pending_func(void *data_v, int i)
}
}
-static void calculate_pending_parents(Depsgraph *graph, int layers)
+static void calculate_pending_parents(Depsgraph *graph, unsigned int layers)
{
const int num_operations = graph->operations.size();
const bool do_threads = num_operations > 256;
@@ -276,11 +276,11 @@ static void calculate_eval_priority(OperationDepsNode *node)
* dec_parents: Decrement pending parents count, true when child nodes are
* scheduled after a task has been completed.
*/
-static void schedule_node(TaskPool *pool, Depsgraph *graph, int layers,
+static void schedule_node(TaskPool *pool, Depsgraph *graph, unsigned int layers,
OperationDepsNode *node, bool dec_parents,
const int thread_id)
{
- int id_layers = node->owner->owner->layers;
+ unsigned int id_layers = node->owner->owner->layers;
if ((node->flag & DEPSOP_FLAG_NEEDS_UPDATE) != 0 &&
(id_layers & layers) != 0)
@@ -314,7 +314,7 @@ static void schedule_node(TaskPool *pool, Depsgraph *graph, int layers,
static void schedule_graph(TaskPool *pool,
Depsgraph *graph,
- const int layers)
+ const unsigned int layers)
{
foreach (OperationDepsNode *node, graph->operations) {
schedule_node(pool, graph, layers, node, false, 0);
@@ -324,7 +324,7 @@ static void schedule_graph(TaskPool *pool,
static void schedule_children(TaskPool *pool,
Depsgraph *graph,
OperationDepsNode *node,
- const int layers,
+ const unsigned int layers,
const int thread_id)
{
foreach (DepsRelation *rel, node->outlinks) {
@@ -352,7 +352,7 @@ static void schedule_children(TaskPool *pool,
*/
void deg_evaluate_on_refresh(EvaluationContext *eval_ctx,
Depsgraph *graph,
- const int layers)
+ const unsigned int layers)
{
/* Generate base evaluation context, upon which all the others are derived. */
// TODO: this needs both main and scene access...
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.h b/source/blender/depsgraph/intern/eval/deg_eval.h
index 92f87b03803..49c0379939e 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval.h
+++ b/source/blender/depsgraph/intern/eval/deg_eval.h
@@ -47,6 +47,6 @@ struct Depsgraph;
*/
void deg_evaluate_on_refresh(EvaluationContext *eval_ctx,
Depsgraph *graph,
- const int layers);
+ const unsigned int layers);
} // namespace DEG
diff --git a/source/blender/depsgraph/intern/nodes/deg_node.h b/source/blender/depsgraph/intern/nodes/deg_node.h
index 416996052c9..b2262c4bd12 100644
--- a/source/blender/depsgraph/intern/nodes/deg_node.h
+++ b/source/blender/depsgraph/intern/nodes/deg_node.h
@@ -176,7 +176,7 @@ struct IDDepsNode : public DepsNode {
GHash *components;
/* Layers of this node with accumulated layers of it's output relations. */
- int layers;
+ unsigned int layers;
/* Additional flags needed for scene evaluation.
* TODO(sergey): Only needed for until really granular updates
diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.cc b/source/blender/depsgraph/intern/nodes/deg_node_component.cc
index 6ac45c99798..5832c458896 100644
--- a/source/blender/depsgraph/intern/nodes/deg_node_component.cc
+++ b/source/blender/depsgraph/intern/nodes/deg_node_component.cc
@@ -120,7 +120,7 @@ string ComponentDepsNode::identifier() const
sprintf(typebuf, "(%d)", type);
char layers[16];
- sprintf(layers, "%d", this->layers);
+ sprintf(layers, "%u", this->layers);
return string(typebuf) + name + " : " + idname + " (Layers: " + layers + ")";
}
diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.h b/source/blender/depsgraph/intern/nodes/deg_node_component.h
index 6f62d91cd79..acccb1cdcd4 100644
--- a/source/blender/depsgraph/intern/nodes/deg_node_component.h
+++ b/source/blender/depsgraph/intern/nodes/deg_node_component.h
@@ -159,7 +159,7 @@ struct ComponentDepsNode : public DepsNode {
// XXX: a poll() callback to check if component's first node can be started?
/* Temporary bitmask, used during graph construction. */
- int layers;
+ unsigned int layers;
};
/* ---------------------------------------- */