Depsgraph: Use proper unsigned int bitfield for layers flags
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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.
|
||||
};
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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...
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 + ")";
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
/* ---------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user