Blender  V3.3
node_shader_value.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
8 #include "node_shader_util.hh"
9 
11 
13 {
14  b.add_output<decl::Float>(N_("Value"));
15 }
16 
17 static int gpu_shader_value(GPUMaterial *mat,
18  bNode *node,
19  bNodeExecData *UNUSED(execdata),
20  GPUNodeStack *in,
22 {
23  GPUNodeLink *link = GPU_uniformbuf_link_out(mat, node, out, 0);
24  return GPU_stack_link(mat, node, "set_value", in, out, link);
25 }
26 
28 {
29  const bNodeSocket *bsocket = (bNodeSocket *)builder.node().outputs.first;
30  const bNodeSocketValueFloat *value = (const bNodeSocketValueFloat *)bsocket->default_value;
32 }
33 
34 } // namespace blender::nodes::node_shader_value_cc
35 
37 {
38  namespace file_ns = blender::nodes::node_shader_value_cc;
39 
40  static bNodeType ntype;
41 
46 
47  nodeRegisterType(&ntype);
48 }
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
Definition: node.cc:4465
#define SH_NODE_VALUE
Definition: BKE_node.h:1080
#define NODE_CLASS_INPUT
Definition: BKE_node.h:345
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
GPUNodeLink * GPU_uniformbuf_link_out(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *stack, int index)
bool GPU_stack_link(GPUMaterial *mat, struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
OperationNode * node
static int gpu_shader_value(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
static void sh_node_value_declare(NodeDeclarationBuilder &b)
static void sh_node_value_build_multi_function(NodeMultiFunctionBuilder &builder)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void sh_fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void register_node_type_sh_value()
void * first
Definition: DNA_listBase.h:31
void * default_value
Defines a node type.
Definition: BKE_node.h:226
NodeMultiFunctionBuildFunction build_multi_function
Definition: BKE_node.h:313
NodeDeclareFunction declare
Definition: BKE_node.h:324
ListBase outputs
#define N_(msgid)