Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_rgb.cc
| Show All 18 Lines | static int gpu_shader_rgb(GPUMaterial *mat, | ||||
| bNodeExecData *UNUSED(execdata), | bNodeExecData *UNUSED(execdata), | ||||
| GPUNodeStack *in, | GPUNodeStack *in, | ||||
| GPUNodeStack *out) | GPUNodeStack *out) | ||||
| { | { | ||||
| GPUNodeLink *link = GPU_uniformbuf_link_out(mat, node, out, 0); | GPUNodeLink *link = GPU_uniformbuf_link_out(mat, node, out, 0); | ||||
| return GPU_stack_link(mat, node, "set_rgba", in, out, link); | return GPU_stack_link(mat, node, "set_rgba", in, out, link); | ||||
| } | } | ||||
| static void sh_node_rgb_build_multi_function(NodeMultiFunctionBuilder &builder) | |||||
| { | |||||
| const bNodeSocket *bsocket = (bNodeSocket *)builder.node().outputs.first; | |||||
| const bNodeSocketValueRGBA *value = (const bNodeSocketValueRGBA *)bsocket->default_value; | |||||
| builder.construct_and_set_matching_fn<fn::CustomMF_Constant<ColorGeometry4f>>(value->value); | |||||
| } | |||||
| } // namespace blender::nodes::node_shader_rgb_cc | } // namespace blender::nodes::node_shader_rgb_cc | ||||
| void register_node_type_sh_rgb() | void register_node_type_sh_rgb() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_rgb_cc; | namespace file_ns = blender::nodes::node_shader_rgb_cc; | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT); | sh_fn_node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT); | ||||
| ntype.declare = file_ns::node_declare; | ntype.declare = file_ns::node_declare; | ||||
| node_type_gpu(&ntype, file_ns::gpu_shader_rgb); | node_type_gpu(&ntype, file_ns::gpu_shader_rgb); | ||||
| ntype.build_multi_function = file_ns::sh_node_rgb_build_multi_function; | |||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||