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:
authorJacques Lucke <jacques@blender.org>2020-08-18 16:51:32 +0300
committerJacques Lucke <jacques@blender.org>2020-08-18 16:51:32 +0300
commit6a4f5e6a8c3990330fe8839e39e0094ba5410ba4 (patch)
tree231d0dd3441ed6c11e801da68ab20d6694f191a7 /source/blender/depsgraph/intern
parentd9f7cbb8af07b27d3825453a036557a0e0dab37b (diff)
Depsgraph: simplify build API
Reviewers: sergey, sybren Differential Revision: https://developer.blender.org/D8611
Diffstat (limited to 'source/blender/depsgraph/intern')
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline.cc11
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline.h2
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline_all_objects.cc7
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline_all_objects.h2
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline_compositor.cc5
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline_compositor.h3
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline_from_ids.cc5
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline_from_ids.h3
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline_render.cc6
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline_render.h2
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline_view_layer.cc7
-rw-r--r--source/blender/depsgraph/intern/builder/pipeline_view_layer.h2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_build.cc40
-rw-r--r--source/blender/depsgraph/intern/depsgraph_debug.cc2
14 files changed, 32 insertions, 65 deletions
diff --git a/source/blender/depsgraph/intern/builder/pipeline.cc b/source/blender/depsgraph/intern/builder/pipeline.cc
index d6893ba11d8..b13077e4792 100644
--- a/source/blender/depsgraph/intern/builder/pipeline.cc
+++ b/source/blender/depsgraph/intern/builder/pipeline.cc
@@ -33,14 +33,11 @@
namespace blender {
namespace deg {
-AbstractBuilderPipeline::AbstractBuilderPipeline(::Depsgraph *graph,
- Main *bmain,
- Scene *scene,
- ViewLayer *view_layer)
+AbstractBuilderPipeline::AbstractBuilderPipeline(::Depsgraph *graph)
: deg_graph_(reinterpret_cast<Depsgraph *>(graph)),
- bmain_(bmain),
- scene_(scene),
- view_layer_(view_layer),
+ bmain_(deg_graph_->bmain),
+ scene_(deg_graph_->scene),
+ view_layer_(deg_graph_->view_layer),
builder_cache_()
{
}
diff --git a/source/blender/depsgraph/intern/builder/pipeline.h b/source/blender/depsgraph/intern/builder/pipeline.h
index 2c9c78bb2cb..d98d834932c 100644
--- a/source/blender/depsgraph/intern/builder/pipeline.h
+++ b/source/blender/depsgraph/intern/builder/pipeline.h
@@ -49,7 +49,7 @@ class DepsgraphRelationBuilder;
*/
class AbstractBuilderPipeline {
public:
- AbstractBuilderPipeline(::Depsgraph *graph, Main *bmain, Scene *scene, ViewLayer *view_layer);
+ AbstractBuilderPipeline(::Depsgraph *graph);
virtual ~AbstractBuilderPipeline();
void build();
diff --git a/source/blender/depsgraph/intern/builder/pipeline_all_objects.cc b/source/blender/depsgraph/intern/builder/pipeline_all_objects.cc
index c926ff7541a..81d239239be 100644
--- a/source/blender/depsgraph/intern/builder/pipeline_all_objects.cc
+++ b/source/blender/depsgraph/intern/builder/pipeline_all_objects.cc
@@ -58,11 +58,8 @@ class AllObjectsRelationBuilder : public DepsgraphRelationBuilder {
} // namespace
-AllObjectsBuilderPipeline::AllObjectsBuilderPipeline(::Depsgraph *graph,
- Main *bmain,
- Scene *scene,
- ViewLayer *view_layer)
- : ViewLayerBuilderPipeline(graph, bmain, scene, view_layer)
+AllObjectsBuilderPipeline::AllObjectsBuilderPipeline(::Depsgraph *graph)
+ : ViewLayerBuilderPipeline(graph)
{
}
diff --git a/source/blender/depsgraph/intern/builder/pipeline_all_objects.h b/source/blender/depsgraph/intern/builder/pipeline_all_objects.h
index 94f00ae840b..11ca2314331 100644
--- a/source/blender/depsgraph/intern/builder/pipeline_all_objects.h
+++ b/source/blender/depsgraph/intern/builder/pipeline_all_objects.h
@@ -33,7 +33,7 @@ namespace deg {
* (and their dependencies). */
class AllObjectsBuilderPipeline : public ViewLayerBuilderPipeline {
public:
- AllObjectsBuilderPipeline(::Depsgraph *graph, Main *bmain, Scene *scene, ViewLayer *view_layer);
+ AllObjectsBuilderPipeline(::Depsgraph *graph);
protected:
virtual unique_ptr<DepsgraphNodeBuilder> construct_node_builder() override;
diff --git a/source/blender/depsgraph/intern/builder/pipeline_compositor.cc b/source/blender/depsgraph/intern/builder/pipeline_compositor.cc
index 3e56f17fc7e..2b9922851c1 100644
--- a/source/blender/depsgraph/intern/builder/pipeline_compositor.cc
+++ b/source/blender/depsgraph/intern/builder/pipeline_compositor.cc
@@ -26,9 +26,8 @@
namespace blender {
namespace deg {
-CompositorBuilderPipeline::CompositorBuilderPipeline(
- ::Depsgraph *graph, Main *bmain, Scene *scene, ViewLayer *view_layer, bNodeTree *nodetree)
- : AbstractBuilderPipeline(graph, bmain, scene, view_layer), nodetree_(nodetree)
+CompositorBuilderPipeline::CompositorBuilderPipeline(::Depsgraph *graph, bNodeTree *nodetree)
+ : AbstractBuilderPipeline(graph), nodetree_(nodetree)
{
deg_graph_->is_render_pipeline_depsgraph = true;
}
diff --git a/source/blender/depsgraph/intern/builder/pipeline_compositor.h b/source/blender/depsgraph/intern/builder/pipeline_compositor.h
index 892ece7c2a4..46f1e3694d3 100644
--- a/source/blender/depsgraph/intern/builder/pipeline_compositor.h
+++ b/source/blender/depsgraph/intern/builder/pipeline_compositor.h
@@ -32,8 +32,7 @@ namespace deg {
class CompositorBuilderPipeline : public AbstractBuilderPipeline {
public:
- CompositorBuilderPipeline(
- ::Depsgraph *graph, Main *bmain, Scene *scene, ViewLayer *view_layer, bNodeTree *nodetree);
+ CompositorBuilderPipeline(::Depsgraph *graph, bNodeTree *nodetree);
protected:
virtual void build_nodes(DepsgraphNodeBuilder &node_builder) override;
diff --git a/source/blender/depsgraph/intern/builder/pipeline_from_ids.cc b/source/blender/depsgraph/intern/builder/pipeline_from_ids.cc
index c42bccaadec..87cfeb46693 100644
--- a/source/blender/depsgraph/intern/builder/pipeline_from_ids.cc
+++ b/source/blender/depsgraph/intern/builder/pipeline_from_ids.cc
@@ -114,9 +114,8 @@ class DepsgraphFromIDsRelationBuilder : public DepsgraphRelationBuilder {
} // namespace
-FromIDsBuilderPipeline::FromIDsBuilderPipeline(
- ::Depsgraph *graph, Main *bmain, Scene *scene, ViewLayer *view_layer, Span<ID *> ids)
- : AbstractBuilderPipeline(graph, bmain, scene, view_layer), ids_(ids)
+FromIDsBuilderPipeline::FromIDsBuilderPipeline(::Depsgraph *graph, Span<ID *> ids)
+ : AbstractBuilderPipeline(graph), ids_(ids)
{
}
diff --git a/source/blender/depsgraph/intern/builder/pipeline_from_ids.h b/source/blender/depsgraph/intern/builder/pipeline_from_ids.h
index a52a9f6f252..79fcfc52446 100644
--- a/source/blender/depsgraph/intern/builder/pipeline_from_ids.h
+++ b/source/blender/depsgraph/intern/builder/pipeline_from_ids.h
@@ -43,8 +43,7 @@ namespace deg {
class FromIDsBuilderPipeline : public AbstractBuilderPipeline {
public:
- FromIDsBuilderPipeline(
- ::Depsgraph *graph, Main *bmain, Scene *scene, ViewLayer *view_layer, Span<ID *> ids);
+ FromIDsBuilderPipeline(::Depsgraph *graph, Span<ID *> ids);
protected:
virtual unique_ptr<DepsgraphNodeBuilder> construct_node_builder() override;
diff --git a/source/blender/depsgraph/intern/builder/pipeline_render.cc b/source/blender/depsgraph/intern/builder/pipeline_render.cc
index 50a37d0d3e4..3b065f7f1bc 100644
--- a/source/blender/depsgraph/intern/builder/pipeline_render.cc
+++ b/source/blender/depsgraph/intern/builder/pipeline_render.cc
@@ -26,11 +26,7 @@
namespace blender {
namespace deg {
-RenderBuilderPipeline::RenderBuilderPipeline(::Depsgraph *graph,
- Main *bmain,
- Scene *scene,
- ViewLayer *view_layer)
- : AbstractBuilderPipeline(graph, bmain, scene, view_layer)
+RenderBuilderPipeline::RenderBuilderPipeline(::Depsgraph *graph) : AbstractBuilderPipeline(graph)
{
deg_graph_->is_render_pipeline_depsgraph = true;
}
diff --git a/source/blender/depsgraph/intern/builder/pipeline_render.h b/source/blender/depsgraph/intern/builder/pipeline_render.h
index df7f9e0de68..91a4be137b6 100644
--- a/source/blender/depsgraph/intern/builder/pipeline_render.h
+++ b/source/blender/depsgraph/intern/builder/pipeline_render.h
@@ -30,7 +30,7 @@ namespace deg {
class RenderBuilderPipeline : public AbstractBuilderPipeline {
public:
- RenderBuilderPipeline(::Depsgraph *graph, Main *bmain, Scene *scene, ViewLayer *view_layer);
+ RenderBuilderPipeline(::Depsgraph *graph);
protected:
virtual void build_nodes(DepsgraphNodeBuilder &node_builder) override;
diff --git a/source/blender/depsgraph/intern/builder/pipeline_view_layer.cc b/source/blender/depsgraph/intern/builder/pipeline_view_layer.cc
index 3223f17f349..f1852a40a10 100644
--- a/source/blender/depsgraph/intern/builder/pipeline_view_layer.cc
+++ b/source/blender/depsgraph/intern/builder/pipeline_view_layer.cc
@@ -26,11 +26,8 @@
namespace blender {
namespace deg {
-ViewLayerBuilderPipeline::ViewLayerBuilderPipeline(::Depsgraph *graph,
- Main *bmain,
- Scene *scene,
- ViewLayer *view_layer)
- : AbstractBuilderPipeline(graph, bmain, scene, view_layer)
+ViewLayerBuilderPipeline::ViewLayerBuilderPipeline(::Depsgraph *graph)
+ : AbstractBuilderPipeline(graph)
{
}
diff --git a/source/blender/depsgraph/intern/builder/pipeline_view_layer.h b/source/blender/depsgraph/intern/builder/pipeline_view_layer.h
index fbd7b98acad..aa85dd7a47b 100644
--- a/source/blender/depsgraph/intern/builder/pipeline_view_layer.h
+++ b/source/blender/depsgraph/intern/builder/pipeline_view_layer.h
@@ -30,7 +30,7 @@ namespace deg {
class ViewLayerBuilderPipeline : public AbstractBuilderPipeline {
public:
- ViewLayerBuilderPipeline(::Depsgraph *graph, Main *bmain, Scene *scene, ViewLayer *view_layer);
+ ViewLayerBuilderPipeline(::Depsgraph *graph);
protected:
virtual void build_nodes(DepsgraphNodeBuilder &node_builder) override;
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index dc49534eb2d..96c17ae4dc5 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -210,49 +210,33 @@ struct Depsgraph *DEG_get_graph_from_handle(struct DepsNodeHandle *node_handle)
/* Graph Building API's */
/* Build depsgraph for the given scene layer, and dump results in given graph container. */
-void DEG_graph_build_from_view_layer(Depsgraph *graph,
- Main *bmain,
- Scene *scene,
- ViewLayer *view_layer)
+void DEG_graph_build_from_view_layer(Depsgraph *graph)
{
- deg::ViewLayerBuilderPipeline builder(graph, bmain, scene, view_layer);
+ deg::ViewLayerBuilderPipeline builder(graph);
builder.build();
}
-void DEG_graph_build_for_all_objects(struct Depsgraph *graph,
- struct Main *bmain,
- struct Scene *scene,
- struct ViewLayer *view_layer)
+void DEG_graph_build_for_all_objects(struct Depsgraph *graph)
{
- deg::AllObjectsBuilderPipeline builder(graph, bmain, scene, view_layer);
+ deg::AllObjectsBuilderPipeline builder(graph);
builder.build();
}
-void DEG_graph_build_for_render_pipeline(Depsgraph *graph,
- Main *bmain,
- Scene *scene,
- ViewLayer *view_layer)
+void DEG_graph_build_for_render_pipeline(Depsgraph *graph)
{
- deg::RenderBuilderPipeline builder(graph, bmain, scene, view_layer);
+ deg::RenderBuilderPipeline builder(graph);
builder.build();
}
-void DEG_graph_build_for_compositor_preview(
- Depsgraph *graph, Main *bmain, Scene *scene, struct ViewLayer *view_layer, bNodeTree *nodetree)
+void DEG_graph_build_for_compositor_preview(Depsgraph *graph, bNodeTree *nodetree)
{
- deg::CompositorBuilderPipeline builder(graph, bmain, scene, view_layer, nodetree);
+ deg::CompositorBuilderPipeline builder(graph, nodetree);
builder.build();
}
-void DEG_graph_build_from_ids(Depsgraph *graph,
- Main *bmain,
- Scene *scene,
- ViewLayer *view_layer,
- ID **ids,
- const int num_ids)
+void DEG_graph_build_from_ids(Depsgraph *graph, ID **ids, const int num_ids)
{
- deg::FromIDsBuilderPipeline builder(
- graph, bmain, scene, view_layer, blender::Span(ids, num_ids));
+ deg::FromIDsBuilderPipeline builder(graph, blender::Span(ids, num_ids));
builder.build();
}
@@ -275,14 +259,14 @@ void DEG_graph_tag_relations_update(Depsgraph *graph)
}
/* Create or update relations in the specified graph. */
-void DEG_graph_relations_update(Depsgraph *graph, Main *bmain, Scene *scene, ViewLayer *view_layer)
+void DEG_graph_relations_update(Depsgraph *graph)
{
deg::Depsgraph *deg_graph = (deg::Depsgraph *)graph;
if (!deg_graph->need_update) {
/* Graph is up to date, nothing to do. */
return;
}
- DEG_graph_build_from_view_layer(graph, bmain, scene, view_layer);
+ DEG_graph_build_from_view_layer(graph);
}
/* Tag all relations for update. */
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc
index 0763738ff59..c5e306f3148 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cc
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cc
@@ -93,7 +93,7 @@ bool DEG_debug_graph_relations_validate(Depsgraph *graph,
{
Depsgraph *temp_depsgraph = DEG_graph_new(bmain, scene, view_layer, DEG_get_mode(graph));
bool valid = true;
- DEG_graph_build_from_view_layer(temp_depsgraph, bmain, scene, view_layer);
+ DEG_graph_build_from_view_layer(temp_depsgraph);
if (!DEG_debug_compare(temp_depsgraph, graph)) {
fprintf(stderr, "ERROR! Depsgraph wasn't tagged for update when it should have!\n");
BLI_assert(!"This should not happen!");