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:
authorAaron Carlisle <carlisle.b3d@gmail.com>2021-12-28 00:21:31 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2021-12-28 00:21:31 +0300
commitd5b72fb06cd0405c4627d22711ab02804093400c (patch)
tree154c5c402f51baa8591d5f803b849dc0c714302b /source/blender/nodes/shader/nodes/node_shader_math.cc
parent336f6f4bbd8eb75c0cc1258e7d9cd367e0983d4d (diff)
Nodes: Declare shader nodes in individual file namespace
To be used in the future to support unity builds
Diffstat (limited to 'source/blender/nodes/shader/nodes/node_shader_math.cc')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_math.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_math.cc b/source/blender/nodes/shader/nodes/node_shader_math.cc
index da237be273f..e683d55edc8 100644
--- a/source/blender/nodes/shader/nodes/node_shader_math.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_math.cc
@@ -28,7 +28,7 @@
/* **************** SCALAR MATH ******************** */
-namespace blender::nodes {
+namespace blender::nodes::node_shader_math_cc {
static void sh_node_math_declare(NodeDeclarationBuilder &b)
{
@@ -57,8 +57,6 @@ static void sh_node_math_gather_link_searches(GatherLinkSearchOpParams &params)
}
}
-} // namespace blender::nodes
-
static const char *gpu_shader_get_name(int mode)
{
const blender::nodes::FloatMathOperationInfo *info =
@@ -174,17 +172,21 @@ static void sh_node_math_build_multi_function(blender::nodes::NodeMultiFunctionB
}
}
+} // namespace blender::nodes::node_shader_math_cc
+
void register_node_type_sh_math()
{
+ namespace file_ns = blender::nodes::node_shader_math_cc;
+
static bNodeType ntype;
sh_fn_node_type_base(&ntype, SH_NODE_MATH, "Math", NODE_CLASS_CONVERTER, 0);
- ntype.declare = blender::nodes::sh_node_math_declare;
+ ntype.declare = file_ns::sh_node_math_declare;
ntype.labelfunc = node_math_label;
- node_type_gpu(&ntype, gpu_shader_math);
+ node_type_gpu(&ntype, file_ns::gpu_shader_math);
node_type_update(&ntype, node_math_update);
- ntype.build_multi_function = sh_node_math_build_multi_function;
- ntype.gather_link_search_ops = blender::nodes::sh_node_math_gather_link_searches;
+ ntype.build_multi_function = file_ns::sh_node_math_build_multi_function;
+ ntype.gather_link_search_ops = file_ns::sh_node_math_gather_link_searches;
nodeRegisterType(&ntype);
}