diff options
Diffstat (limited to 'source/blender/depsgraph/intern/eval')
4 files changed, 13 insertions, 17 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index d40e3e85979..4dd3842070e 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -69,7 +69,6 @@ static void schedule_children(TaskPool *pool, const int thread_id); struct DepsgraphEvalState { - EvaluationContext *eval_ctx; Depsgraph *graph; bool do_stats; }; @@ -86,11 +85,11 @@ static void deg_task_run_func(TaskPool *pool, /* Perform operation. */ if (state->do_stats) { const double start_time = PIL_check_seconds_timer(); - node->evaluate(state->eval_ctx); + node->evaluate((::Depsgraph*)state->graph); node->stats.current_time += PIL_check_seconds_timer() - start_time; } else { - node->evaluate(state->eval_ctx); + node->evaluate((::Depsgraph*)state->graph); } /* Schedule children. */ BLI_task_pool_delayed_push_begin(pool, thread_id); @@ -229,21 +228,20 @@ static void schedule_children(TaskPool *pool, */ void deg_evaluate_on_refresh(Depsgraph *graph) { - /* Set time for the current graph evaluation context. */ - TimeSourceDepsNode *time_src = graph->find_time_source(); /* Nothing to update, early out. */ if (BLI_gset_len(graph->entry_tags) == 0) { return; } const bool do_time_debug = ((G.debug & G_DEBUG_DEPSGRAPH_TIME) != 0); const double start_time = do_time_debug ? PIL_check_seconds_timer() : 0; - /* Set up evaluation context. */ - EvaluationContext eval_ctx; - DEG_evaluation_context_init_from_depsgraph(&eval_ctx, (::Depsgraph*)graph, graph->mode); - eval_ctx.ctime = time_src->cfra; + + /* TODO: Calling this forces the scene datablock to be expanded, + * otherwise we get crashes on load with copy-on-write. There may + * be a better solution for this. */ + DEG_get_evaluated_view_layer((const ::Depsgraph*)graph); + /* Set up evaluation state. */ DepsgraphEvalState state; - state.eval_ctx = &eval_ctx; state.graph = graph; state.do_stats = do_time_debug; /* Set up task scheduler and pull for threaded evaluation. */ diff --git a/source/blender/depsgraph/intern/eval/deg_eval.h b/source/blender/depsgraph/intern/eval/deg_eval.h index 0fb60e8f779..a8f5f7c145f 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.h +++ b/source/blender/depsgraph/intern/eval/deg_eval.h @@ -32,8 +32,6 @@ #pragma once -struct EvaluationContext; - namespace DEG { struct Depsgraph; diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 1d2169f5ec4..91790522590 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -781,10 +781,10 @@ void deg_free_copy_on_write_datablock(ID *id_cow) id_cow->name[0] = '\0'; } -void deg_evaluate_copy_on_write(const EvaluationContext * /*eval_ctx*/, - const Depsgraph *depsgraph, +void deg_evaluate_copy_on_write(struct ::Depsgraph *graph, const IDDepsNode *id_node) { + const DEG::Depsgraph *depsgraph = reinterpret_cast<const DEG::Depsgraph *>(graph); DEBUG_PRINT("%s on %s\n", __func__, id_node->id_orig->name); if (id_node->id_orig == &depsgraph->scene->id) { /* NOTE: This is handled by eval_ctx setup routines, which diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h index a2b57cb7198..8fca90e9f5b 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h @@ -32,7 +32,6 @@ #include <stddef.h> -struct EvaluationContext; struct ID; /* Unkomment this to have verbose log about original and CoW pointers @@ -47,6 +46,8 @@ struct ID; # define DEG_COW_PRINT(format, ...) #endif +struct Depsgraph; + namespace DEG { struct Depsgraph; @@ -79,8 +80,7 @@ void deg_free_copy_on_write_datablock(struct ID *id_cow); /* Callback function for depsgraph operation node which ensures copy-on-write * datablock is ready for use by further evaluation routines. */ -void deg_evaluate_copy_on_write(const struct EvaluationContext *eval_ctx, - const struct Depsgraph *depsgraph, +void deg_evaluate_copy_on_write(struct ::Depsgraph *depsgraph, const struct IDDepsNode *id_node); /* Check that given ID is propely expanded and does not have any shallow |