Blender V5.0
compositor/utilities/intern/gpu_material.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "BLI_string_ref.hh"
6
7#include "DNA_node_types.h"
8
9#include "BKE_node_runtime.hh"
10
11#include "GPU_material.hh"
12
14
15namespace blender::compositor {
16
19 const StringRef identifier)
20{
21 return inputs[node.input_by_identifier(identifier)->index()];
22}
23
26 const StringRef identifier)
27{
28 return outputs[node.output_by_identifier(identifier)->index()];
29}
30
33 const StringRef identifier)
34{
35 GPUNodeStack &input = get_shader_node_input(node, inputs, identifier);
36 if (input.link) {
37 return input.link;
38 }
39 return GPU_uniform(input.vec);
40}
41
42} // namespace blender::compositor
GPUNodeLink * GPU_uniform(const float *num)
#define input
GPUNodeStack & get_shader_node_input(const bNode &node, GPUNodeStack inputs[], StringRef identifier)
GPUNodeStack & get_shader_node_output(const bNode &node, GPUNodeStack outputs[], StringRef identifier)
GPUNodeLink * get_shader_node_input_link(const bNode &node, GPUNodeStack inputs[], StringRef identifier)
static blender::bke::bNodeSocketTemplate outputs[]
static blender::bke::bNodeSocketTemplate inputs[]