Blender V4.3
gpu_shader_3D_polyline_info.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11
12GPU_SHADER_INTERFACE_INFO(gpu_shader_3D_polyline_iface, "interp")
13 .smooth(Type::VEC4, "final_color")
14 .smooth(Type::FLOAT, "clip");
15
16GPU_SHADER_INTERFACE_INFO(gpu_shader_3D_polyline_noperspective_iface, "interp_noperspective")
17 .no_perspective(Type::FLOAT, "smoothline");
18
19GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline)
20 .define("SMOOTH_WIDTH", "1.0")
21 .push_constant(Type::MAT4, "ModelViewProjectionMatrix")
22 .push_constant(Type::VEC2, "viewportSize")
23 .push_constant(Type::FLOAT, "lineWidth")
24 .push_constant(Type::BOOL, "lineSmooth")
25 .vertex_in(0, Type::VEC3, "pos")
26 .vertex_out(gpu_shader_3D_polyline_iface)
27 .vertex_out(gpu_shader_3D_polyline_noperspective_iface)
28 .geometry_layout(PrimitiveIn::LINES, PrimitiveOut::TRIANGLE_STRIP, 4)
29 .geometry_out(gpu_shader_3D_polyline_iface)
30 .geometry_out(gpu_shader_3D_polyline_noperspective_iface)
31 .fragment_out(0, Type::VEC4, "fragColor")
32 .vertex_source("gpu_shader_3D_polyline_vert.glsl")
33 .geometry_source("gpu_shader_3D_polyline_geom.glsl")
34 .fragment_source("gpu_shader_3D_polyline_frag.glsl")
35 .additional_info("gpu_srgb_to_framebuffer_space");
36
37GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline_no_geom)
38 .define("SMOOTH_WIDTH", "1.0")
39 .push_constant(Type::MAT4, "ModelViewProjectionMatrix")
40 .push_constant(Type::VEC2, "viewportSize")
41 .push_constant(Type::FLOAT, "lineWidth")
42 .push_constant(Type::BOOL, "lineSmooth")
43 .vertex_in(0, Type::VEC3, "pos")
44 .vertex_out(gpu_shader_3D_polyline_iface)
45 .vertex_out(gpu_shader_3D_polyline_noperspective_iface)
46 .fragment_out(0, Type::VEC4, "fragColor")
47 .vertex_source("gpu_shader_3D_polyline_vert_no_geom.glsl")
48 .fragment_source("gpu_shader_3D_polyline_frag.glsl")
49 .additional_info("gpu_srgb_to_framebuffer_space");
50
51GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline_uniform_color)
52 .do_static_compilation(true)
53 .define("UNIFORM")
54 .push_constant(Type::VEC4, "color")
55 .additional_info("gpu_shader_3D_polyline");
56
57GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline_uniform_color_no_geom)
58 .metal_backend_only(true)
59 .do_static_compilation(true)
60 .define("UNIFORM")
61 .push_constant(Type::VEC4, "color")
62 .additional_info("gpu_shader_3D_polyline_no_geom");
63
64GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline_uniform_color_clipped)
65 .do_static_compilation(true)
66 /* TODO(fclem): Put in a UBO to fit the 128byte requirement. */
67 .push_constant(Type::MAT4, "ModelMatrix")
68 .push_constant(Type::VEC4, "ClipPlane")
69 .define("CLIP")
70 .additional_info("gpu_shader_3D_polyline_uniform_color");
71
72GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline_uniform_color_clipped_no_geom)
73 .metal_backend_only(true)
74 .do_static_compilation(true)
75 /* TODO(fclem): Put in an UBO to fit the 128byte requirement. */
76 .push_constant(Type::MAT4, "ModelMatrix")
77 .push_constant(Type::VEC4, "ClipPlane")
78 .define("CLIP")
79 .additional_info("gpu_shader_3D_polyline_uniform_color_no_geom");
80
81GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline_flat_color)
82 .do_static_compilation(true)
83 .define("FLAT")
84 .vertex_in(1, Type::VEC4, "color")
85 .additional_info("gpu_shader_3D_polyline");
86
87GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline_flat_color_no_geom)
88 .metal_backend_only(true)
89 .do_static_compilation(true)
90 .define("FLAT")
91 .vertex_in(1, Type::VEC4, "color")
92 .additional_info("gpu_shader_3D_polyline_no_geom");
93
94GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline_smooth_color)
95 .do_static_compilation(true)
96 .define("SMOOTH")
97 .vertex_in(1, Type::VEC4, "color")
98 .additional_info("gpu_shader_3D_polyline");
99
100GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline_smooth_color_no_geom)
101 .metal_backend_only(true)
102 .do_static_compilation(true)
103 .define("SMOOTH")
104 .vertex_in(1, Type::VEC4, "color")
105 .additional_info("gpu_shader_3D_polyline_no_geom");
#define GPU_SHADER_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_CREATE_INFO(_info)