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());
96 stack.
hasinput = socket->is_logically_linked();
97 stack.
hasoutput = socket->is_logically_linked();
100void ShaderNode::populate_inputs()
104 const int num_input_sockets = node_->input_sockets().size();
105 inputs_.
resize(num_input_sockets + 1);
108 for (
int i = 0;
i < num_input_sockets;
i++) {
113void ShaderNode::populate_outputs()
117 const int num_output_sockets = node_->output_sockets().size();
118 outputs_.resize(num_output_sockets + 1);
119 outputs_.last().end =
true;
121 for (
int i = 0;
i < num_output_sockets;
i++) {
#define BLI_assert_unreachable()
MINLINE void zero_v4(float r[4])
const T & last(const int64_t n=0) const
void resize(const int64_t new_size)
static bool is_single_value_only_type(ResultType type)
GPUNodeStack & get_input(StringRef identifier)
void compile(GPUMaterial *material)
GPUNodeStack & get_output(StringRef identifier)
const bNodeSocket * bsocket() const
GPUNodeStack & get_shader_node_input(const bNode &node, GPUNodeStack inputs[], StringRef identifier)
GPUNodeStack & get_shader_node_output(const bNode &node, GPUNodeStack outputs[], StringRef identifier)
ResultType get_node_socket_result_type(const bNodeSocket *socket)
static GPUType gpu_type_from_socket(DSocket socket)
static void populate_gpu_node_stack(DSocket socket, GPUNodeStack &stack)