Blender  V3.3
gpu_shader_2D_nodelink_info.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2022 Blender Foundation. All rights reserved. */
3 
9 
10 GPU_SHADER_INTERFACE_INFO(nodelink_iface, "")
11  .smooth(Type::VEC4, "finalColor")
12  .smooth(Type::FLOAT, "colorGradient")
13  .smooth(Type::FLOAT, "lineU")
14  .flat(Type::FLOAT, "lineLength")
15  .flat(Type::FLOAT, "dashFactor")
16  .flat(Type::FLOAT, "dashAlpha")
17  .flat(Type::INT, "isMainLine");
18 
19 GPU_SHADER_CREATE_INFO(gpu_shader_2D_nodelink)
20  .vertex_in(0, Type::VEC2, "uv")
21  .vertex_in(1, Type::VEC2, "pos")
22  .vertex_in(2, Type::VEC2, "expand")
23  .vertex_out(nodelink_iface)
24  .fragment_out(0, Type::VEC4, "fragColor")
25  .uniform_buf(0, "NodeLinkData", "node_link_data", Frequency::PASS)
26  .push_constant(Type::MAT4, "ModelViewProjectionMatrix")
27  .vertex_source("gpu_shader_2D_nodelink_vert.glsl")
28  .fragment_source("gpu_shader_2D_nodelink_frag.glsl")
29  .typedef_source("GPU_shader_shared.h")
30  .do_static_compilation(true);
31 
32 GPU_SHADER_CREATE_INFO(gpu_shader_2D_nodelink_inst)
33  .vertex_in(0, Type::VEC2, "uv")
34  .vertex_in(1, Type::VEC2, "pos")
35  .vertex_in(2, Type::VEC2, "expand")
36  .vertex_in(3, Type::VEC2, "P0")
37  .vertex_in(4, Type::VEC2, "P1")
38  .vertex_in(5, Type::VEC2, "P2")
39  .vertex_in(6, Type::VEC2, "P3")
40  .vertex_in(7, Type::IVEC4, "colid_doarrow")
41  .vertex_in(8, Type::VEC4, "start_color")
42  .vertex_in(9, Type::VEC4, "end_color")
43  .vertex_in(10, Type::IVEC2, "domuted")
44  .vertex_in(11, Type::FLOAT, "dim_factor")
45  .vertex_in(12, Type::FLOAT, "thickness")
46  .vertex_in(13, Type::FLOAT, "dash_factor")
47  .vertex_in(14, Type::FLOAT, "dash_alpha")
48  .vertex_out(nodelink_iface)
49  .fragment_out(0, Type::VEC4, "fragColor")
50  .uniform_buf(0, "NodeLinkInstanceData", "node_link_data", Frequency::PASS)
51  .push_constant(Type::MAT4, "ModelViewProjectionMatrix")
52  .vertex_source("gpu_shader_2D_nodelink_vert.glsl")
53  .fragment_source("gpu_shader_2D_nodelink_frag.glsl")
54  .typedef_source("GPU_shader_shared.h")
55  .define("USE_INSTANCE")
56  .do_static_compilation(true);
#define GPU_SHADER_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_CREATE_INFO(_info)
@ FLOAT