20using namespace nodes::derived_node_tree_types;
24 this->populate_inputs();
25 this->populate_outputs();
30 node_->typeinfo->gpu_fn(
31 material,
const_cast<bNode *
>(node_.bnode()),
nullptr, inputs_.data(), outputs_.data());
78 stack.
hasinput = socket->is_logically_linked();
79 stack.
hasoutput = socket->is_logically_linked();
82void ShaderNode::populate_inputs()
86 const int num_input_sockets = node_->input_sockets().size();
87 inputs_.
resize(num_input_sockets + 1);
90 for (
int i = 0;
i < num_input_sockets;
i++) {
95void ShaderNode::populate_outputs()
99 const int num_output_sockets = node_->output_sockets().size();
100 outputs_.resize(num_output_sockets + 1);
101 outputs_.last().end =
true;
103 for (
int i = 0;
i < num_output_sockets;
i++) {
MINLINE void zero_v4(float r[4])
const T & last(const int64_t n=0) const
void resize(const int64_t new_size)
GPUNodeStack & get_input(StringRef identifier)
void compile(GPUMaterial *material)
GPUNodeStack & get_output(StringRef identifier)
GPUNodeStack & get_shader_node_input(const bNode &node, GPUNodeStack inputs[], StringRef identifier)
static eGPUType gpu_type_from_socket_type(eNodeSocketDatatype type)
GPUNodeStack & get_shader_node_output(const bNode &node, GPUNodeStack outputs[], StringRef identifier)
static void populate_gpu_node_stack(DSocket socket, GPUNodeStack &stack)