[Bf-blender-cvs] [ffbe506a559] functions: rename DFGraphSocket to DataSocket
Jacques Lucke
noreply at git.blender.org
Thu Aug 1 18:23:06 CEST 2019
Commit: ffbe506a55915542216ef0ea9182c0f17d92f726
Author: Jacques Lucke
Date: Thu Aug 1 13:33:40 2019 +0200
Branches: functions
https://developer.blender.org/rBffbe506a55915542216ef0ea9182c0f17d92f726
rename DFGraphSocket to DataSocket
===================================================================
M source/blender/functions/backends/dependencies/fgraph_dependencies.cpp
M source/blender/functions/backends/llvm/fgraph_ir_generation.cpp
M source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp
M source/blender/functions/core/data_graph.cpp
M source/blender/functions/core/data_graph.hpp
M source/blender/functions/core/function_builder.cpp
M source/blender/functions/core/function_builder.hpp
M source/blender/functions/core/function_graph.cpp
M source/blender/functions/core/function_graph.hpp
M source/blender/functions/frontends/data_flow_nodes/function_generation.cpp
M source/blender/functions/frontends/data_flow_nodes/vtree_data_graph.cpp
M source/blender/functions/frontends/data_flow_nodes/vtree_data_graph.hpp
M source/blender/functions/frontends/data_flow_nodes/vtree_data_graph_builder.cpp
M source/blender/simulations/bparticles/inserters.cpp
M source/blender/simulations/bparticles/particle_function_builder.cpp
M source/blender/simulations/bparticles/particle_function_builder.hpp
===================================================================
diff --git a/source/blender/functions/backends/dependencies/fgraph_dependencies.cpp b/source/blender/functions/backends/dependencies/fgraph_dependencies.cpp
index a55f14a3f09..c71ccbd3b65 100644
--- a/source/blender/functions/backends/dependencies/fgraph_dependencies.cpp
+++ b/source/blender/functions/backends/dependencies/fgraph_dependencies.cpp
@@ -16,14 +16,13 @@ class FGraphDependencies : public DepsBody {
void build_deps(FunctionDepsBuilder &builder) const override
{
for (uint i = 0; i < m_fgraph.outputs().size(); i++) {
- DFGraphSocket socket = m_fgraph.outputs()[i];
+ DataSocket socket = m_fgraph.outputs()[i];
Vector<ID *> outputs = this->find_deps_and_outputs(socket, builder);
builder.add_output_ids(i, outputs);
}
}
- Vector<ID *> find_deps_and_outputs(DFGraphSocket socket,
- FunctionDepsBuilder &parent_builder) const
+ Vector<ID *> find_deps_and_outputs(DataSocket socket, FunctionDepsBuilder &parent_builder) const
{
if (m_fgraph.inputs().contains(socket)) {
return parent_builder.get_input_ids(m_fgraph.inputs().index(socket));
diff --git a/source/blender/functions/backends/llvm/fgraph_ir_generation.cpp b/source/blender/functions/backends/llvm/fgraph_ir_generation.cpp
index 209d1e557a8..f286246ef5d 100644
--- a/source/blender/functions/backends/llvm/fgraph_ir_generation.cpp
+++ b/source/blender/functions/backends/llvm/fgraph_ir_generation.cpp
@@ -8,7 +8,7 @@ class BuildGraphIR : public LLVMBuildIRBody {
private:
FunctionGraph m_fgraph;
DataGraph *m_graph;
- Set<DFGraphSocket> m_required_sockets;
+ Set<DataSocket> m_required_sockets;
public:
BuildGraphIR(FunctionGraph &fgraph) : m_fgraph(fgraph), m_graph(fgraph.graph().ptr())
@@ -35,14 +35,14 @@ class BuildGraphIR : public LLVMBuildIRBody {
CodeInterface &interface,
const BuildIRSettings &settings) const override
{
- Map<DFGraphSocket, llvm::Value *> values;
+ Map<DataSocket, llvm::Value *> values;
for (uint i = 0; i < m_fgraph.inputs().size(); i++) {
values.add(m_fgraph.inputs()[i], interface.get_input(i));
}
- Set<DFGraphSocket> forwarded_sockets;
+ Set<DataSocket> forwarded_sockets;
for (uint i = 0; i < m_fgraph.outputs().size(); i++) {
- DFGraphSocket socket = m_fgraph.outputs()[i];
+ DataSocket socket = m_fgraph.outputs()[i];
this->generate_for_socket(builder, interface, settings, socket, values, forwarded_sockets);
interface.set_output(i, values.lookup(socket));
@@ -53,22 +53,22 @@ class BuildGraphIR : public LLVMBuildIRBody {
void generate_for_socket(CodeBuilder &builder,
CodeInterface &interface,
const BuildIRSettings &settings,
- DFGraphSocket socket,
- Map<DFGraphSocket, llvm::Value *> &values,
- Set<DFGraphSocket> &forwarded_sockets) const
+ DataSocket socket,
+ Map<DataSocket, llvm::Value *> &values,
+ Set<DataSocket> &forwarded_sockets) const
{
if (values.contains(socket)) {
/* do nothing */
}
else if (socket.is_input()) {
- DFGraphSocket origin = m_graph->origin_of_input(socket);
+ DataSocket origin = m_graph->origin_of_input(socket);
this->generate_for_socket(builder, interface, settings, origin, values, forwarded_sockets);
this->forward_output_if_necessary(builder, origin, values, forwarded_sockets);
}
else if (socket.is_output()) {
uint node_id = m_graph->node_id_of_output(socket);
Vector<llvm::Value *> input_values;
- for (DFGraphSocket input_socket : m_graph->inputs_of_node(node_id)) {
+ for (DataSocket input_socket : m_graph->inputs_of_node(node_id)) {
this->generate_for_socket(
builder, interface, settings, input_socket, values, forwarded_sockets);
input_values.append(values.lookup(input_socket));
@@ -78,7 +78,7 @@ class BuildGraphIR : public LLVMBuildIRBody {
builder, interface, settings, node_id, input_values);
uint index = 0;
- for (DFGraphSocket output_socket : m_graph->outputs_of_node(node_id)) {
+ for (DataSocket output_socket : m_graph->outputs_of_node(node_id)) {
values.add(output_socket, output_values[index]);
this->forward_output_if_necessary(builder, output_socket, values, forwarded_sockets);
index++;
@@ -90,9 +90,9 @@ class BuildGraphIR : public LLVMBuildIRBody {
}
void forward_output_if_necessary(CodeBuilder &builder,
- DFGraphSocket output,
- Map<DFGraphSocket, llvm::Value *> &values,
- Set<DFGraphSocket> &forwarded_sockets) const
+ DataSocket output,
+ Map<DataSocket, llvm::Value *> &values,
+ Set<DataSocket> &forwarded_sockets) const
{
BLI_assert(output.is_output());
if (!forwarded_sockets.contains(output)) {
@@ -102,15 +102,15 @@ class BuildGraphIR : public LLVMBuildIRBody {
}
void forward_output(CodeBuilder &builder,
- DFGraphSocket output,
- Map<DFGraphSocket, llvm::Value *> &values) const
+ DataSocket output,
+ Map<DataSocket, llvm::Value *> &values) const
{
llvm::Value *value_to_forward = values.lookup(output);
SharedType &type = m_graph->type_of_socket(output);
LLVMTypeInfo &type_info = type->extension<LLVMTypeInfo>();
- Vector<DFGraphSocket> targets;
- for (DFGraphSocket target : m_graph->targets_of_output(output)) {
+ Vector<DataSocket> targets;
+ for (DataSocket target : m_graph->targets_of_output(output)) {
if (m_required_sockets.contains(target) && !values.contains(target)) {
BLI_assert(type == m_graph->type_of_socket(target));
targets.append(target);
@@ -126,7 +126,7 @@ class BuildGraphIR : public LLVMBuildIRBody {
else {
values.add(targets[0], value_to_forward);
for (uint i = 1; i < targets.size(); i++) {
- DFGraphSocket target = targets[i];
+ DataSocket target = targets[i];
llvm::Value *copied_value = type_info.build_copy_ir(builder, value_to_forward);
values.add(target, copied_value);
}
diff --git a/source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp b/source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp
index 888bde78b16..f0ed1c976b0 100644
--- a/source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp
+++ b/source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp
@@ -213,7 +213,7 @@ class ExecuteFGraph : public TupleCallBody {
void copy_inputs_to_storage(Tuple &fn_in, Tuple &fn_out, SocketValueStorage &storage) const
{
for (uint i = 0; i < m_fgraph.inputs().size(); i++) {
- DFGraphSocket socket = m_fgraph.inputs()[i];
+ DataSocket socket = m_fgraph.inputs()[i];
if (socket.is_input()) {
fn_in.relocate_out__dynamic(i, storage.input_value_ptr(socket.id()));
storage.set_input_initialized(socket.id(), true);
@@ -256,7 +256,7 @@ class ExecuteFGraph : public TupleCallBody {
true, \
false);
- using SocketsToComputeStack = Stack<DFGraphSocket, 64>;
+ using SocketsToComputeStack = Stack<DataSocket, 64>;
using LazyStatesStack = Stack<LazyStateOfNode>;
void evaluate_graph_to_compute_outputs(SocketValueStorage &storage,
@@ -271,14 +271,14 @@ class ExecuteFGraph : public TupleCallBody {
}
while (!sockets_to_compute.empty()) {
- DFGraphSocket socket = sockets_to_compute.peek();
+ DataSocket socket = sockets_to_compute.peek();
if (socket.is_input()) {
if (storage.is_input_initialized(socket.id())) {
sockets_to_compute.pop();
}
else {
- DFGraphSocket origin = m_graph->origin_of_input(socket);
+ DataSocket origin = m_graph->origin_of_input(socket);
if (storage.is_output_initialized(origin.id())) {
this->forward_output(origin.id(), storage, fn_out);
sockets_to_compute.pop();
@@ -378,7 +378,7 @@ class ExecuteFGraph : public TupleCallBody {
for (uint input_index : body->always_required()) {
uint input_id = m_graph->id_of_node_input(node_id, input_index);
if (!storage.is_input_initialized(input_id)) {
- sockets_to_compute.push(DFGraphSocket::FromInput(input_id));
+ sockets_to_compute.push(DataSocket::FromInput(input_id));
required_inputs_computed = false;
}
}
@@ -393,7 +393,7 @@ class ExecuteFGraph : public TupleCallBody {
for (uint requested_input_index : state.requested_inputs()) {
uint input_id = m_graph->id_of_node_input(node_id, requested_input_index);
if (!storage.is_input_initialized(input_id)) {
- sockets_to_compute.push(DFGraphSocket::FromInput(input_id));
+ sockets_to_compute.push(DataSocket::FromInput(input_id));
}
}
}
@@ -405,7 +405,7 @@ class ExecuteFGraph : public TupleCallBody {
bool all_inputs_computed = true;
for (uint input_id : m_graph->input_ids_of_node(node_id)) {
if (!storage.is_input_initialized(input_id)) {
- sockets_to_compute.push(DFGraphSocket::FromInput(input_id));
+ sockets_to_compute.push(DataSocket::FromInput(input_id));
all_inputs_computed = false;
}
}
@@ -418,7 +418,7 @@ class ExecuteFGraph : public TupleCallBody {
{
for (uint output_id : m_graph->output_ids_of_node(node_id)) {
if (m_output_info[output_id].is_fn_output) {
- uint index = m_fgraph.outputs().index(DFGraphSocket::FromOutput(output_id));
+ uint index = m_fgraph.outputs().index(DataSocket::FromOutput(output_id));
fn_out.copy_in__dynamic(index, storage.output_value_ptr(output_id));
}
}
@@ -525,7 +525,7 @@ class ExecuteFGraph : public TupleCallBody {
for (uint target_id : target_ids) {
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list