22 this->populate_inputs();
23 this->populate_outputs();
28 node_.typeinfo->gpu_fn(
29 material,
const_cast<bNode *
>(&node_),
nullptr, inputs_.data(), outputs_.data());
44 switch (socket.
type) {
105 stack.
link =
nullptr;
113 stack.
hasinput = socket.is_logically_linked();
114 stack.
hasoutput = socket.is_logically_linked();
117void ShaderNode::populate_inputs()
121 const int num_input_sockets = node_.input_sockets().size();
122 inputs_.resize(num_input_sockets + 1);
123 inputs_.last().end =
true;
125 for (
int i = 0; i < num_input_sockets; i++) {
130void ShaderNode::populate_outputs()
134 const int num_output_sockets = node_.output_sockets().size();
135 outputs_.resize(num_output_sockets + 1);
136 outputs_.last().end =
true;
138 for (
int i = 0; i < num_output_sockets; i++) {
#define BLI_assert_unreachable()
ShaderNode(const NodeType *type)
virtual void compile(SVMCompiler &compiler)=0
static bool is_single_value_only_type(ResultType type)
GPUNodeStack & get_input(StringRef identifier)
GPUNodeStack & get_output(StringRef identifier)
static void populate_gpu_node_stack(const bNodeSocket &socket, GPUNodeStack &stack)
ResultType get_node_socket_result_type(const bNodeSocket *socket)
static GPUType gpu_type_from_socket(const bNodeSocket &socket)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
GPUNodeStack & GPU_node_get_input(const bNode &node, GPUNodeStack inputs[], StringRef identifier)
GPUNodeStackValue GPU_node_stack_default_value(const GPUType type)
GPUNodeStack & GPU_node_get_output(const bNode &node, GPUNodeStack outputs[], StringRef identifier)