Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/depsgraph_build.cc
| Show First 20 Lines • Show All 309 Lines • ▼ Show 20 Lines | void DEG_graph_build_for_render_pipeline(Depsgraph *graph, | ||||
| /* Finalize building. */ | /* Finalize building. */ | ||||
| graph_build_finalize_common(deg_graph, bmain); | graph_build_finalize_common(deg_graph, bmain); | ||||
| /* Finish statistics. */ | /* Finish statistics. */ | ||||
| if (G.debug & (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_TIME)) { | if (G.debug & (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_TIME)) { | ||||
| printf("Depsgraph built in %f seconds.\n", PIL_check_seconds_timer() - start_time); | printf("Depsgraph built in %f seconds.\n", PIL_check_seconds_timer() - start_time); | ||||
| } | } | ||||
| } | } | ||||
| void DEG_graph_build_for_compositor_preview(Depsgraph *graph, | |||||
| Main *bmain, | |||||
| Scene *scene, | |||||
| struct ViewLayer * /*view_layer*/, | |||||
| bNodeTree *nodetree) | |||||
| { | |||||
| double start_time = 0.0; | |||||
| if (G.debug & (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_TIME)) { | |||||
| start_time = PIL_check_seconds_timer(); | |||||
| } | |||||
| DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph); | |||||
| /* Perform sanity checks. */ | |||||
| BLI_assert(deg_graph->scene == scene); | |||||
| deg_graph->is_render_pipeline_depsgraph = true; | |||||
| DEG::DepsgraphBuilderCache builder_cache; | |||||
| /* Generate all the nodes in the graph first */ | |||||
| DEG::DepsgraphNodeBuilder node_builder(bmain, deg_graph, &builder_cache); | |||||
| node_builder.begin_build(); | |||||
| node_builder.build_scene_render(scene); | |||||
| node_builder.build_nodetree(nodetree); | |||||
| node_builder.end_build(); | |||||
| /* Hook up relationships between operations - to determine evaluation | |||||
| * order. */ | |||||
| DEG::DepsgraphRelationBuilder relation_builder(bmain, deg_graph, &builder_cache); | |||||
| relation_builder.begin_build(); | |||||
| relation_builder.build_scene_render(scene); | |||||
| relation_builder.build_nodetree(nodetree); | |||||
| relation_builder.build_copy_on_write_relations(); | |||||
| /* Finalize building. */ | |||||
| graph_build_finalize_common(deg_graph, bmain); | |||||
| /* Finish statistics. */ | |||||
| if (G.debug & (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_TIME)) { | |||||
| printf("Depsgraph built in %f seconds.\n", PIL_check_seconds_timer() - start_time); | |||||
| } | |||||
| } | |||||
| /* Tag graph relations for update. */ | /* Tag graph relations for update. */ | ||||
| void DEG_graph_tag_relations_update(Depsgraph *graph) | void DEG_graph_tag_relations_update(Depsgraph *graph) | ||||
| { | { | ||||
| DEG_DEBUG_PRINTF(graph, TAG, "%s: Tagging relations for update.\n", __func__); | DEG_DEBUG_PRINTF(graph, TAG, "%s: Tagging relations for update.\n", __func__); | ||||
| DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph); | DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph); | ||||
| deg_graph->need_update = true; | deg_graph->need_update = true; | ||||
| /* NOTE: When relations are updated, it's quite possible that | /* NOTE: When relations are updated, it's quite possible that | ||||
| * we've got new bases in the scene. This means, we need to | * we've got new bases in the scene. This means, we need to | ||||
| Show All 34 Lines | |||||