./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
0 / 263
0.0%
Branches:
0 / 592
0.0%
Functions:
0 / 25
0.0%

libs/render/src/eu/render/shader_resource.cc
Line Branch Exec Source
1 #include "eu/render/shader_resource.h"
2
3 #include "eu/assert/assert.h"
4
5
6 #include "eu/render/camera.h"
7 #include "eu/render/constants.h"
8 #include "eu/render/fullscreen.h"
9 #include "eu/render/render_settings.h"
10 #include "eu/render/shader.h"
11 #include "eu/render/shader.source.h"
12
13
14 namespace internal
15 {
16 namespace
17 {
18 using namespace eu;
19 using namespace eu::render;
20
21
22 ✗ std::optional<Uniform> get_uniform(
23 ShaderProgram& prog, const std::string& name, PostProcSetup setup, PostProcSetup flag
24 )
25 {
26
0/2
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 8 not taken.
✗ if (is_flag_set(setup, flag))
27 {
28
0/2
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 10 not taken.
✗ return prog.get_uniform(name);
29 }
30 else
31 {
32 ✗ return std::nullopt;
33 }
34 }
35
36
37 using BaseShaderData = std::vector<core::VertexType>;
38
39
40
41 template<std::size_t count>
42 ✗ BaseShaderData get_vertex_types(const std::array<const core::ShaderVertexAttributes*, count>& vas)
43 {
44 ✗ std::set<core::VertexType> unique_types;
45 ✗ auto ret = BaseShaderData{};
46
0/2
✗ Branch 25 → 5 not taken.
✗ Branch 25 → 26 not taken.
✗ for (const auto& va : vas)
47 {
48
0/2
✗ Branch 23 → 7 not taken.
✗ Branch 23 → 24 not taken.
✗ for (const auto& v : *va)
49 {
50
0/2
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 29 not taken.
✗ const auto [_, is_unique] = unique_types.insert(v.type);
51
0/2
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ if (is_unique)
52 {
53
0/2
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 29 not taken.
✗ ret.emplace_back(v.type);
54 }
55 }
56 }
57 ✗ return ret;
58 ✗ }
59
60
61
62 // todo(Gustav): should this be a tuple instead? this way the members are named
63 struct LoadedShader
64 {
65 ✗ LoadedShader(std::shared_ptr<ShaderProgram> p, core::CompiledGeomVertexAttributes l)
66 ✗ : program(std::move(p))
67 ✗ , geom_layout(std::move(l))
68 ✗ {}
69
70 std::shared_ptr<ShaderProgram> program;
71 core::CompiledGeomVertexAttributes geom_layout;
72 };
73
74 ✗ std::optional<int> get_instance_start_index(const LoadedShader* shader)
75 {
76
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 6 not taken.
✗ if (shader == nullptr)
77 {
78 ✗ return std::nullopt;
79 }
80
81 ✗ const core::CompiledGeomVertexAttributes& layout = shader->geom_layout;
82
83 ✗ int max = 0;
84
85
0/2
✗ Branch 20 → 8 not taken.
✗ Branch 20 → 21 not taken.
✗ for (const auto& entry : layout.elements)
86 {
87 ✗ max = std::max(entry.index, max);
88 }
89
90 ✗ return max + 1;
91 }
92
93 ✗ LoadedShader load_shader(DEBUG_LABEL_ARG_MANY const BaseShaderData& base_layout, const ShaderSource_withLayout& source, TransformSource model_source, const LoadedShader* instance_base = nullptr)
94 {
95
0/8
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 47 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 45 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 51 → 53 not taken.
✗ auto layout_compiler = compile_attribute_layouts(base_layout, { source.layout });
96
0/2
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 83 not taken.
✗ const auto geom_layout = get_geom_layout(layout_compiler);
97
98 ✗ std::optional<core::InstanceProp> instance_prop = std::nullopt;
99 ✗ std::optional<int> start_index = std::nullopt;
100
0/3
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 22 not taken.
✗ Branch 13 → 23 not taken.
✗ switch (model_source)
101 {
102 ✗ case TransformSource::instanced_mat4:
103
0/2
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 61 not taken.
✗ instance_prop = core::InstanceProp
104 {
105 .type = core::VertexType::instance_transform,
106 ✗ .name = "u_world_from_local"
107 ✗ };
108
0/2
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 79 not taken.
✗ start_index = get_instance_start_index(instance_base);
109 ✗ break;
110 ✗ case TransformSource::uniform: break;
111
0/6
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 79 not taken.
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 29 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 65 not taken.
✗ default: ASSERT(false && "unhandled ModelSource");
112 }
113
114
0/4
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 70 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 68 not taken.
✗ const auto compiled_layout = compile_shader_layout(layout_compiler, source.layout, instance_prop, start_index);
115
116
0/2
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 77 not taken.
✗ auto program = std::make_shared<ShaderProgram>(USE_DEBUG_LABEL_MANY(debug_label) source.vertex, source.fragment, compiled_layout);
117
118
0/2
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 71 not taken.
✗ return { program, geom_layout };
119
0/6
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 54 not taken.
✗ Branch 54 → 55 not taken.
✗ Branch 54 → 58 not taken.
✗ Branch 56 → 57 not taken.
✗ Branch 56 → 58 not taken.
✗ }
120 }
121 }
122
123
124 namespace eu::render
125 {
126
127
128
129 ✗ void CameraUniformBuffer::set_props(const CompiledCamera& cc) // NOLINT(readability-make-member-function-const)
130 {
131 ✗ buffer->set_mat4(clip_from_view_uni, cc.clip_from_view);
132 ✗ buffer->set_mat4(view_from_world_uni, cc.view_from_world);
133 ✗ }
134
135
136
137 ✗ LoadedShader_SingleColor::LoadedShader_SingleColor(
138 std::shared_ptr<ShaderProgram> p, core::CompiledGeomVertexAttributes l, const CameraUniformBuffer& desc
139 ✗ )
140 ✗ : program(std::move(p))
141 ✗ , geom_layout(std::move(l))
142
0/4
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 27 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 25 not taken.
✗ , tint_color_uni(program->get_uniform("u_material.diffuse_tint"))
143
0/4
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 33 not taken.
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 31 not taken.
✗ , world_from_local_uni(program->get_uniform("u_world_from_local"))
144 {
145
0/2
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 37 not taken.
✗ program->setup_uniform_block(desc.setup);
146 ✗ }
147
148
149
150 ✗ LoadedShader_Skybox::LoadedShader_Skybox(
151 std::shared_ptr<ShaderProgram> p, core::CompiledGeomVertexAttributes l, const CameraUniformBuffer& desc
152 ✗ )
153 ✗ : program(std::move(p))
154 ✗ , geom_layout(std::move(l))
155
0/4
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 27 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 25 not taken.
✗ , tex_skybox_uniform(program->get_uniform("u_skybox_tex"))
156 {
157
0/4
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 33 not taken.
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 31 not taken.
✗ setup_textures(program.get(), {&tex_skybox_uniform});
158
0/2
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 38 not taken.
✗ program->setup_uniform_block(desc.setup);
159 ✗ }
160
161 ✗ LoadedShader_OnlyDepth::LoadedShader_OnlyDepth(
162 TransformSource model_source,
163 std::shared_ptr<ShaderProgram> p,
164 core::CompiledGeomVertexAttributes l,
165 const CameraUniformBuffer& desc
166 ✗ )
167 ✗ : program(std::move(p))
168 ✗ , geom_layout(std::move(l))
169 ✗ , world_from_local_uni(
170
0/18
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 15 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 26 not taken.
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 26 not taken.
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 18 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 23 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 28 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 32 not taken.
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 37 not taken.
✗ model_source == TransformSource::uniform ? std::optional<Uniform>{program->get_uniform("u_world_from_local")}
171 : std::nullopt
172 )
173 {
174
0/2
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 39 not taken.
✗ program->setup_uniform_block(desc.setup);
175 ✗ }
176
177 ✗ LoadedShader_Unlit::LoadedShader_Unlit(
178 TransformSource model_source,
179 std::shared_ptr<ShaderProgram> p,
180 const CameraUniformBuffer& desc
181 ✗ )
182 ✗ : program(std::move(p))
183
0/4
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 46 not taken.
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 44 not taken.
✗ , tint_color_uni(program->get_uniform("u_material.diffuse_tint"))
184
0/4
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 52 not taken.
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 50 not taken.
✗ , tex_diffuse_uniform(program->get_uniform("u_material.diffuse_tex"))
185 ✗ , world_from_local_uni(
186
0/18
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 26 not taken.
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 56 not taken.
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 56 not taken.
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 34 not taken.
✗ Branch 56 → 57 not taken.
✗ Branch 56 → 58 not taken.
✗ Branch 60 → 61 not taken.
✗ Branch 60 → 62 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 67 not taken.
✗ model_source == TransformSource::uniform ? std::optional<Uniform>{program->get_uniform("u_world_from_local")} : std::nullopt
187 )
188 {
189
0/4
✗ Branch 36 → 37 not taken.
✗ Branch 36 → 71 not taken.
✗ Branch 38 → 39 not taken.
✗ Branch 38 → 69 not taken.
✗ setup_textures(program.get(), {&tex_diffuse_uniform});
190
0/2
✗ Branch 42 → 43 not taken.
✗ Branch 42 → 76 not taken.
✗ program->setup_uniform_block(desc.setup);
191 ✗ }
192
193
194
195 ✗ DirectionalLightUniforms::DirectionalLightUniforms(const ShaderProgram* program, const std::string& base)
196
0/4
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 14 not taken.
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 12 not taken.
✗ : light_diffuse_color_uni(program->get_uniform(base + "diffuse"))
197
0/4
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 17 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 15 not taken.
✗ , light_specular_color_uni(program->get_uniform(base + "specular"))
198
0/4
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 20 not taken.
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 18 not taken.
✗ , dir_uni(program->get_uniform(base + "dir"))
199 {
200 ✗ }
201
202
203
204 ✗ PointLightUniforms::PointLightUniforms(const ShaderProgram* program, const std::string& base)
205
0/4
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 17 not taken.
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 15 not taken.
✗ : light_diffuse_color_uni(program->get_uniform(base + "diffuse"))
206
0/4
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ , light_specular_color_uni(program->get_uniform(base + "specular"))
207
0/4
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 23 not taken.
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 21 not taken.
✗ , light_attenuation_uni(program->get_uniform(base + "attenuation"))
208
0/4
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 26 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 24 not taken.
✗ , light_world_uni(program->get_uniform(base + "world_pos"))
209 {
210 ✗ }
211
212
213
214 ✗ FrustumLightUniforms::FrustumLightUniforms(const ShaderProgram* program, const std::string& base)
215
0/4
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 23 not taken.
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 21 not taken.
✗ : diffuse_uni(program->get_uniform(base + "diffuse"))
216
0/4
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 26 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 24 not taken.
✗ , specular_uni(program->get_uniform(base + "specular"))
217
0/4
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 29 not taken.
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 27 not taken.
✗ , attenuation_uni(program->get_uniform(base + "attenuation"))
218
0/4
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 32 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 30 not taken.
✗ , clip_from_world_uni(program->get_uniform(base + "clip_from_world"))
219
0/4
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 35 not taken.
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 33 not taken.
✗ , world_pos_uni(program->get_uniform(base + "world_pos"))
220
0/4
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 38 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 36 not taken.
✗ , tex_cookie_uniform(program->get_uniform(base + "cookie"))
221 {
222 ✗ }
223
224
225
226 ✗ PostProcSetup operator|(PostProcSetup lhs, PostProcSetup rhs)
227 {
228 ✗ return static_cast<PostProcSetup>(base_cast(lhs) | base_cast(rhs));
229 }
230
231
232
233
234
235
236 ✗ LoadedPostProcShader::LoadedPostProcShader(std::shared_ptr<ShaderProgram> s, PostProcSetup setup)
237 ✗ : program(std::move(s))
238
0/4
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 43 not taken.
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 41 not taken.
✗ , tex_input_uniform(program->get_uniform("u_texture"))
239
0/4
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 49 not taken.
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 47 not taken.
✗ , factor_uni(internal::get_uniform(*program, "u_factor", setup, PostProcSetup::factor))
240
0/4
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 55 not taken.
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 53 not taken.
✗ , resolution_uni(internal::get_uniform(*program, "u_resolution", setup, PostProcSetup::resolution))
241
0/4
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 61 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 59 not taken.
✗ , time_uni(internal::get_uniform(*program, "u_time", setup, PostProcSetup::time))
242 {
243
0/4
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 67 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 65 not taken.
✗ setup_textures(program.get(), {&tex_input_uniform});
244 ✗ }
245
246
247
248 ✗ LoadedShader_Default::LoadedShader_Default(
249 TransformSource model_source,
250 std::shared_ptr<ShaderProgram> p,
251 const RenderSettings& settings,
252 const CameraUniformBuffer& desc
253 ✗ )
254 ✗ : program(std::move(p))
255
0/4
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 155 not taken.
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 153 not taken.
✗ , tint_color_uni(program->get_uniform("u_material.diffuse_tint"))
256
0/4
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 161 not taken.
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 159 not taken.
✗ , tex_directional_light_depth_uni(program->get_uniform("u_directional_light_depth_tex"))
257
0/4
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 167 not taken.
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 165 not taken.
✗ , directional_shadow_clip_from_world_uni(program->get_uniform("u_directional_shadow_clip_from_world"))
258
0/4
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 173 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 171 not taken.
✗ , tex_diffuse_uniform(program->get_uniform("u_material.diffuse_tex"))
259
0/4
✗ Branch 36 → 37 not taken.
✗ Branch 36 → 179 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 177 not taken.
✗ , tex_specular_uniform(program->get_uniform("u_material.specular_tex"))
260
0/4
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 185 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 183 not taken.
✗ , tex_emissive_uniform(program->get_uniform("u_material.emissive_tex"))
261
0/4
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 191 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 51 → 189 not taken.
✗ , ambient_tint_uni(program->get_uniform("u_material.ambient_tint"))
262
0/4
✗ Branch 57 → 58 not taken.
✗ Branch 57 → 197 not taken.
✗ Branch 58 → 59 not taken.
✗ Branch 58 → 195 not taken.
✗ , specular_color_uni(program->get_uniform("u_material.specular_tint"))
263
0/4
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 203 not taken.
✗ Branch 65 → 66 not taken.
✗ Branch 65 → 201 not taken.
✗ , shininess_uni(program->get_uniform("u_material.shininess"))
264
0/4
✗ Branch 71 → 72 not taken.
✗ Branch 71 → 209 not taken.
✗ Branch 72 → 73 not taken.
✗ Branch 72 → 207 not taken.
✗ , emissive_factor_uni(program->get_uniform("u_material.emissive_factor"))
265 ✗ , world_from_local_uni(
266
0/18
✗ Branch 75 → 76 not taken.
✗ Branch 75 → 82 not taken.
✗ Branch 79 → 80 not taken.
✗ Branch 79 → 213 not taken.
✗ Branch 80 → 81 not taken.
✗ Branch 80 → 213 not taken.
✗ Branch 83 → 84 not taken.
✗ Branch 83 → 85 not taken.
✗ Branch 85 → 86 not taken.
✗ Branch 85 → 87 not taken.
✗ Branch 87 → 88 not taken.
✗ Branch 87 → 90 not taken.
✗ Branch 213 → 214 not taken.
✗ Branch 213 → 215 not taken.
✗ Branch 217 → 218 not taken.
✗ Branch 217 → 219 not taken.
✗ Branch 221 → 222 not taken.
✗ Branch 221 → 224 not taken.
✗ model_source == TransformSource::uniform ? std::optional<Uniform>{program->get_uniform("u_world_from_local")} : std::nullopt
267 )
268
0/4
✗ Branch 93 → 94 not taken.
✗ Branch 93 → 228 not taken.
✗ Branch 94 → 95 not taken.
✗ Branch 94 → 226 not taken.
✗ , view_position_uni(program->get_uniform("u_view_position"))
269
0/4
✗ Branch 100 → 101 not taken.
✗ Branch 100 → 234 not taken.
✗ Branch 101 → 102 not taken.
✗ Branch 101 → 232 not taken.
✗ , light_ambient_color_uni(program->get_uniform("u_ambient_light"))
270 {
271
0/2
✗ Branch 113 → 108 not taken.
✗ Branch 113 → 114 not taken.
✗ for (int index = 0; index < settings.number_of_directional_lights; index += 1)
272 {
273
0/2
✗ Branch 108 → 109 not taken.
✗ Branch 108 → 238 not taken.
✗ const std::string base = fmt::format("u_directional_lights[{}].", index);
274
0/2
✗ Branch 110 → 111 not taken.
✗ Branch 110 → 239 not taken.
✗ directional_lights.emplace_back(program.get(), base);
275 ✗ }
276
277
0/2
✗ Branch 120 → 115 not taken.
✗ Branch 120 → 121 not taken.
✗ for (int index = 0; index < settings.number_of_point_lights; index += 1)
278 {
279
0/2
✗ Branch 115 → 116 not taken.
✗ Branch 115 → 244 not taken.
✗ const std::string base = fmt::format("u_point_lights[{}].", index);
280
0/2
✗ Branch 117 → 118 not taken.
✗ Branch 117 → 245 not taken.
✗ point_lights.emplace_back(program.get(), base);
281 ✗ }
282
283
0/2
✗ Branch 127 → 122 not taken.
✗ Branch 127 → 128 not taken.
✗ for (int index = 0; index < settings.number_of_frustum_lights; index += 1)
284 {
285
0/2
✗ Branch 122 → 123 not taken.
✗ Branch 122 → 250 not taken.
✗ const std::string base = fmt::format("u_frustum_lights[{}].", index);
286
0/2
✗ Branch 124 → 125 not taken.
✗ Branch 124 → 251 not taken.
✗ frustum_lights.emplace_back(program.get(), base);
287 ✗ }
288
289
0/2
✗ Branch 130 → 131 not taken.
✗ Branch 130 → 256 not taken.
✗ std::vector<Uniform*> textures = {&tex_directional_light_depth_uni, &tex_diffuse_uniform, &tex_specular_uniform, &tex_emissive_uniform};
290
0/2
✗ Branch 146 → 134 not taken.
✗ Branch 146 → 147 not taken.
✗ for (auto& fl: frustum_lights)
291 {
292
0/2
✗ Branch 136 → 137 not taken.
✗ Branch 136 → 260 not taken.
✗ textures.emplace_back(&fl.tex_cookie_uniform);
293 }
294
295
0/2
✗ Branch 148 → 149 not taken.
✗ Branch 148 → 262 not taken.
✗ setup_textures(program.get(), textures);
296
0/2
✗ Branch 150 → 151 not taken.
✗ Branch 150 → 262 not taken.
✗ program->setup_uniform_block(desc.setup);
297 ✗ }
298
299
300
301 ✗ bool LoadedShader_Unlit_Container::is_loaded() const
302 {
303
0/4
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 9 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
✗ return default_shader.program->is_loaded() && transparency_shader.program->is_loaded();
304 }
305
306
307
308 ✗ const LoadedShader_Unlit& shader_from_container(const LoadedShader_Unlit_Container& container, const RenderContext& rc)
309 {
310
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
✗ return rc.use_transparency == UseTransparency::yes ? container.transparency_shader : container.default_shader;
311 }
312
313 ✗ const LoadedShader_Default& shader_from_container(const LoadedShader_Default_Container& container, const RenderContext& rc)
314 {
315
0/3
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 7 not taken.
✗ Branch 2 → 15 not taken.
✗ switch (rc.model_source)
316 {
317 ✗ case TransformSource::uniform:
318
0/2
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
✗ return rc.use_transparency == UseTransparency::yes ? container.transparency_shader : container.default_shader;
319 ✗ case TransformSource::instanced_mat4:
320
0/6
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 14 not taken.
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 14 not taken.
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 23 not taken.
✗ ASSERT(rc.use_transparency == UseTransparency::no); // not currently supporting instanced transparency
321 ✗ return container.default_shader_instance;
322
0/4
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 21 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 26 not taken.
✗ default: ASSERT(false && "unhandled"); return container.default_shader;
323 }
324 }
325
326
327
328
329 ✗ bool LoadedShader_Default_Container::is_loaded() const
330 {
331
0/4
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 9 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
✗ return default_shader.program->is_loaded() && transparency_shader.program->is_loaded();
332 }
333
334
335
336
337 ✗ RealizeShader::RealizeShader(std::shared_ptr<ShaderProgram> s)
338 ✗ : program(std::move(s))
339
0/4
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 50 not taken.
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 48 not taken.
✗ , tex_input_uniform(program->get_uniform("u_texture"))
340
0/4
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 56 not taken.
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 54 not taken.
✗ , tex_blurred_bloom_uniform(program->get_uniform("u_blurred_bloom"))
341
0/4
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 62 not taken.
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 60 not taken.
✗ , use_blur_uniform(program->get_uniform("u_use_blur"))
342
0/4
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 68 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 66 not taken.
✗ , gamma_uniform(program->get_uniform("u_gamma"))
343
0/4
✗ Branch 36 → 37 not taken.
✗ Branch 36 → 74 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 72 not taken.
✗ , exposure_uniform(program->get_uniform("u_exposure"))
344 {
345
0/4
✗ Branch 42 → 43 not taken.
✗ Branch 42 → 80 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 78 not taken.
✗ setup_textures(program.get(), {&tex_input_uniform, &tex_blurred_bloom_uniform});
346 ✗ }
347
348
349
350 ✗ ExtractShader::ExtractShader(std::shared_ptr<LoadedPostProcShader>&& sh)
351 ✗ : shader(std::move(sh))
352
0/4
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 24 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 22 not taken.
✗ , cutoff_uniform(shader->program->get_uniform("u_cutoff"))
353
0/4
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 30 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 28 not taken.
✗ , softness_uniform(shader->program->get_uniform("u_softness"))
354 {
355 ✗ }
356
357 ✗ PingPongBlurShader::PingPongBlurShader(std::shared_ptr<LoadedPostProcShader>&& sh)
358 ✗ : shader(std::move(sh))
359
0/4
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 16 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 14 not taken.
✗ , is_horizontal_uniform(shader->program->get_uniform("u_is_horizontal"))
360 {
361 ✗ }
362
363
364
365 ✗ bool ShaderResource::is_loaded() const
366 {
367 ✗ return single_color_shader.program->is_loaded()
368
0/2
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 22 not taken.
✗ && depth_transform_uniform.program->is_loaded()
369
0/2
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 22 not taken.
✗ && depth_transform_instanced_mat4.program->is_loaded()
370
0/2
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 22 not taken.
✗ && skybox_shader.program->is_loaded()
371
0/2
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 22 not taken.
✗ && unlit_shader_container.is_loaded()
372
0/2
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 22 not taken.
✗ && default_shader_container.is_loaded()
373
0/4
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 22 not taken.
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 22 not taken.
✗ && pp_realize.program->is_loaded();
374 }
375
376
377
378 ✗ ShaderResource load_shaders(const Assets& assets, const CameraUniformBuffer& desc, const RenderSettings& settings, const FullScreenGeom& full_screen)
379 {
380 ✗ const auto& default_shader_source = assets.default_shader_source;
381 ✗ const auto& skybox_shader_source = assets.skybox_shader_source;
382
383
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 238 not taken.
✗ const auto single_color_shader = load_shader_source(default_shader_source, {}, desc.setup.source);
384
385 ✗ ShaderOptions depth_shader_options;
386 ✗ depth_shader_options.only_depth = true;
387
0/2
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 478 not taken.
✗ const auto depth_transform_uniform = load_shader_source(default_shader_source, depth_shader_options, desc.setup.source);
388
0/4
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 239 not taken.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 239 not taken.
✗ const auto depth_transform_instanced_mat4 = load_shader_source(default_shader_source, depth_shader_options.with_instanced_mat4(), desc.setup.source);
389
390
0/2
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 474 not taken.
✗ const auto skybox_source = load_skybox_source(skybox_shader_source, desc.setup.source);
391 const auto skybox_shader = ShaderSource_withLayout{
392 .layout = core::ShaderVertexAttributes
393 {
394 {
395 .type = core::VertexType::position3,
396 ✗ .name = "a_position"
397 }
398 ✗ },
399 .vertex = skybox_source.vertex,
400 .fragment = skybox_source.fragment
401
0/18
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 246 not taken.
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 243 not taken.
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 240 not taken.
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 19 not taken.
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 24 not taken.
✗ Branch 240 → 241 not taken.
✗ Branch 240 → 242 not taken.
✗ Branch 243 → 244 not taken.
✗ Branch 243 → 245 not taken.
✗ Branch 250 → 251 not taken.
✗ Branch 250 → 253 not taken.
✗ };
402
403 const internal::BaseShaderData global_shader_data = internal::get_vertex_types<3>
404 ({
405 &single_color_shader.layout,
406 &depth_transform_uniform.layout,
407 &depth_transform_instanced_mat4.layout
408
0/2
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 263 not taken.
✗ });
409
410 ✗ ShaderOptions unlit_shader_options;
411 ✗ unlit_shader_options.use_texture = true;
412
413 ✗ ShaderOptions default_shader_options;
414 ✗ default_shader_options.use_lights = true;
415 ✗ default_shader_options.use_texture = true;
416 ✗ default_shader_options.number_of_directional_lights = settings.number_of_directional_lights;
417 ✗ default_shader_options.number_of_point_lights = settings.number_of_point_lights;
418 ✗ default_shader_options.number_of_frustum_lights = settings.number_of_frustum_lights;
419
420 auto loaded_unlit = internal::load_shader(
421
0/2
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 266 not taken.
✗ USE_DEBUG_LABEL_MANY("unlit")
422 global_shader_data,
423
0/4
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 272 not taken.
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 272 not taken.
✗ load_shader_source(default_shader_source, unlit_shader_options.with_transparent_cutoff(), desc.setup.source),
424 TransformSource::uniform
425
0/2
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 264 not taken.
✗ );
426 auto loaded_default = internal::load_shader(
427
0/2
✗ Branch 39 → 40 not taken.
✗ Branch 39 → 276 not taken.
✗ USE_DEBUG_LABEL_MANY("default")
428 global_shader_data,
429
0/4
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 282 not taken.
✗ Branch 36 → 37 not taken.
✗ Branch 36 → 282 not taken.
✗ load_shader_source(default_shader_source, default_shader_options.with_transparent_cutoff(), desc.setup.source),
430 TransformSource::uniform
431
0/2
✗ Branch 40 → 41 not taken.
✗ Branch 40 → 274 not taken.
✗ );
432 auto loaded_default_instanced = internal::load_shader(
433
0/2
✗ Branch 49 → 50 not taken.
✗ Branch 49 → 286 not taken.
✗ USE_DEBUG_LABEL_MANY("default instanced")
434 global_shader_data,
435
0/6
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 292 not taken.
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 292 not taken.
✗ Branch 46 → 47 not taken.
✗ Branch 46 → 292 not taken.
✗ load_shader_source(default_shader_source, default_shader_options.with_transparent_cutoff().with_instanced_mat4(), desc.setup.source),
436 TransformSource::instanced_mat4
437
0/2
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 284 not taken.
✗ );
438
439 auto loaded_unlit_transparency = internal::load_shader(
440
0/2
✗ Branch 57 → 58 not taken.
✗ Branch 57 → 297 not taken.
✗ USE_DEBUG_LABEL_MANY("unlit transparency")
441
0/2
✗ Branch 54 → 55 not taken.
✗ Branch 54 → 303 not taken.
✗ global_shader_data, load_shader_source(default_shader_source, unlit_shader_options, desc.setup.source), TransformSource::uniform
442
0/2
✗ Branch 58 → 59 not taken.
✗ Branch 58 → 295 not taken.
✗ );
443 auto loaded_default_transparency = internal::load_shader(
444
0/2
✗ Branch 65 → 66 not taken.
✗ Branch 65 → 306 not taken.
✗ USE_DEBUG_LABEL_MANY("default transparency")
445
0/2
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 312 not taken.
✗ global_shader_data, load_shader_source(default_shader_source, default_shader_options, desc.setup.source), TransformSource::uniform
446
0/2
✗ Branch 66 → 67 not taken.
✗ Branch 66 → 304 not taken.
✗ );
447
448 // todo(Gustav): should the asserts here be runtime errors? currently all setups are compile-time...
449
0/10
✗ Branch 70 → 71 not taken.
✗ Branch 70 → 458 not taken.
✗ Branch 71 → 72 not taken.
✗ Branch 71 → 78 not taken.
✗ Branch 72 → 73 not taken.
✗ Branch 72 → 458 not taken.
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 78 not taken.
✗ Branch 75 → 76 not taken.
✗ Branch 75 → 313 not taken.
✗ ASSERT(loaded_unlit.geom_layout.debug_types == loaded_unlit_transparency.geom_layout.debug_types);
450
0/10
✗ Branch 78 → 79 not taken.
✗ Branch 78 → 458 not taken.
✗ Branch 79 → 80 not taken.
✗ Branch 79 → 86 not taken.
✗ Branch 80 → 81 not taken.
✗ Branch 80 → 458 not taken.
✗ Branch 81 → 82 not taken.
✗ Branch 81 → 86 not taken.
✗ Branch 83 → 84 not taken.
✗ Branch 83 → 316 not taken.
✗ ASSERT(loaded_default.geom_layout.debug_types == loaded_default_transparency.geom_layout.debug_types);
451
0/10
✗ Branch 86 → 87 not taken.
✗ Branch 86 → 458 not taken.
✗ Branch 87 → 88 not taken.
✗ Branch 87 → 94 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 458 not taken.
✗ Branch 89 → 90 not taken.
✗ Branch 89 → 94 not taken.
✗ Branch 91 → 92 not taken.
✗ Branch 91 → 319 not taken.
✗ ASSERT(
452 loaded_default.geom_layout.debug_types == loaded_default_instanced.geom_layout.debug_types
453 ); // is this valid? should this fail?
454
455 #if TODO_ADD_CUSTOM_EFFECTS
456 auto pp_invert = std::make_shared<LoadedPostProcShader>(
457 std::make_shared<ShaderProgram>(
458 USE_DEBUG_LABEL_MANY("pp invert")
459 std::string{PP_VERT_GLSL}, std::string{PP_INVERT_FRAG_GLSL}, full_screen.layout
460 ),
461 PostProcSetup::factor
462 );
463 auto pp_grayscale = std::make_shared<LoadedPostProcShader>(
464 std::make_shared<ShaderProgram>(
465 USE_DEBUG_LABEL_MANY("pp grayscale")
466 std::string{PP_VERT_GLSL}, std::string{PP_GRAYSCALE_FRAG_GLSL}, full_screen.layout
467 ),
468 PostProcSetup::factor
469 );
470 auto pp_damage = std::make_shared<LoadedPostProcShader>(
471 std::make_shared<ShaderProgram>(
472 USE_DEBUG_LABEL_MANY("pp damage")
473 std::string{PP_VERT_GLSL}, std::string{PP_DAMAGE_FRAG_GLSL}, full_screen.layout
474 ),
475 PostProcSetup::factor | PostProcSetup::resolution | PostProcSetup::time
476 );
477
478 constexpr IsGauss use_gauss =
479 #if FF_HAS(BLUR_USE_GAUSS)
480 IsGauss::yes
481 #else
482 IsGauss::no
483 #endif
484 ;
485
486 auto pp_blurv = std::make_shared<LoadedPostProcShader>(
487 std::make_shared<ShaderProgram>(
488 USE_DEBUG_LABEL_MANY("pp blur vert")
489 std::string{PP_VERT_GLSL},
490 generate_blur(PP_BLUR_FRAG_GLSL, {BlurType::vertical, blur_samples, use_gauss}),
491 full_screen.layout
492 ),
493 PostProcSetup::factor
494 );
495 auto pp_blurh = std::make_shared<LoadedPostProcShader>(
496 std::make_shared<ShaderProgram>(
497 USE_DEBUG_LABEL_MANY("pp blur hor")
498 std::string{PP_VERT_GLSL},
499 generate_blur(PP_BLUR_FRAG_GLSL, {BlurType::horizontal, blur_samples, use_gauss}),
500 full_screen.layout
501 ),
502 PostProcSetup::factor | PostProcSetup::resolution
503 );
504 #endif
505
506 ✗ auto pp_realize = RealizeShader{std::make_shared<ShaderProgram>(
507 USE_DEBUG_LABEL_MANY("pp realize")
508
0/2
✗ Branch 94 → 95 not taken.
✗ Branch 94 → 324 not taken.
✗ assets.pp_vert_glsl, assets.pp_realize_frag_glsl, full_screen.layout
509
0/2
✗ Branch 95 → 96 not taken.
✗ Branch 95 → 322 not taken.
✗ )};
510
0/2
✗ Branch 98 → 99 not taken.
✗ Branch 98 → 327 not taken.
✗ auto pp_extract = ExtractShader{std::make_shared<LoadedPostProcShader>(
511 ✗ std::make_shared<ShaderProgram>(
512 ✗ USE_DEBUG_LABEL_MANY("pp extract") assets.pp_vert_glsl,
513 ✗ assets.pp_extract_frag_glsl,
514 ✗ full_screen.layout
515 ),
516
0/2
✗ Branch 97 → 98 not taken.
✗ Branch 97 → 329 not taken.
✗ PostProcSetup::none
517
0/2
✗ Branch 99 → 100 not taken.
✗ Branch 99 → 325 not taken.
✗ )};
518
0/2
✗ Branch 103 → 104 not taken.
✗ Branch 103 → 334 not taken.
✗ auto pp_ping = PingPongBlurShader{std::make_shared<LoadedPostProcShader>(
519 ✗ std::make_shared<ShaderProgram>(
520 ✗ USE_DEBUG_LABEL_MANY("pp ping-pong") assets.pp_vert_glsl,
521 ✗ assets.pp_ping_pong_blur_frag_glsl,
522 ✗ full_screen.layout
523 ),
524
0/2
✗ Branch 102 → 103 not taken.
✗ Branch 102 → 336 not taken.
✗ PostProcSetup::none
525
0/2
✗ Branch 104 → 105 not taken.
✗ Branch 104 → 332 not taken.
✗ )};
526
527 auto loaded_single_color = internal::load_shader(
528
0/2
✗ Branch 109 → 110 not taken.
✗ Branch 109 → 341 not taken.
✗ USE_DEBUG_LABEL_MANY("single color") global_shader_data, single_color_shader, TransformSource::uniform
529
0/2
✗ Branch 110 → 111 not taken.
✗ Branch 110 → 339 not taken.
✗ );
530 auto loaded_depth_transform_uniform = internal::load_shader(
531
0/2
✗ Branch 115 → 116 not taken.
✗ Branch 115 → 347 not taken.
✗ USE_DEBUG_LABEL_MANY("depth transform uniform") global_shader_data, depth_transform_uniform, TransformSource::uniform
532
0/2
✗ Branch 116 → 117 not taken.
✗ Branch 116 → 345 not taken.
✗ );
533 auto loaded_depth_transform_instanced_mat4 = load_shader(
534
0/2
✗ Branch 121 → 122 not taken.
✗ Branch 121 → 353 not taken.
✗ USE_DEBUG_LABEL_MANY("depth transform instanced") global_shader_data, depth_transform_instanced_mat4, TransformSource::instanced_mat4, &loaded_default_instanced
535
0/2
✗ Branch 122 → 123 not taken.
✗ Branch 122 → 351 not taken.
✗ );
536 auto loaded_skybox_shader
537
0/4
✗ Branch 128 → 129 not taken.
✗ Branch 128 → 359 not taken.
✗ Branch 129 → 130 not taken.
✗ Branch 129 → 357 not taken.
✗ = internal::load_shader(USE_DEBUG_LABEL_MANY("skybox"){}, skybox_shader, TransformSource::uniform);
538
539
540
0/64
✗ Branch 137 → 138 not taken.
✗ Branch 137 → 438 not taken.
✗ Branch 142 → 143 not taken.
✗ Branch 142 → 429 not taken.
✗ Branch 147 → 148 not taken.
✗ Branch 147 → 420 not taken.
✗ Branch 152 → 153 not taken.
✗ Branch 152 → 411 not taken.
✗ Branch 153 → 154 not taken.
✗ Branch 153 → 408 not taken.
✗ Branch 157 → 158 not taken.
✗ Branch 157 → 402 not taken.
✗ Branch 161 → 162 not taken.
✗ Branch 161 → 396 not taken.
✗ Branch 162 → 163 not taken.
✗ Branch 162 → 393 not taken.
✗ Branch 166 → 167 not taken.
✗ Branch 166 → 387 not taken.
✗ Branch 170 → 171 not taken.
✗ Branch 170 → 381 not taken.
✗ Branch 174 → 175 not taken.
✗ Branch 174 → 375 not taken.
✗ Branch 175 → 176 not taken.
✗ Branch 175 → 372 not taken.
✗ Branch 176 → 177 not taken.
✗ Branch 176 → 369 not taken.
✗ Branch 177 → 178 not taken.
✗ Branch 177 → 366 not taken.
✗ Branch 179 → 180 not taken.
✗ Branch 179 → 181 not taken.
✗ Branch 181 → 182 not taken.
✗ Branch 181 → 183 not taken.
✗ Branch 183 → 184 not taken.
✗ Branch 183 → 185 not taken.
✗ Branch 194 → 195 not taken.
✗ Branch 194 → 196 not taken.
✗ Branch 202 → 203 not taken.
✗ Branch 202 → 204 not taken.
✗ Branch 366 → 367 not taken.
✗ Branch 366 → 368 not taken.
✗ Branch 369 → 370 not taken.
✗ Branch 369 → 371 not taken.
✗ Branch 372 → 373 not taken.
✗ Branch 372 → 374 not taken.
✗ Branch 378 → 379 not taken.
✗ Branch 378 → 380 not taken.
✗ Branch 384 → 385 not taken.
✗ Branch 384 → 386 not taken.
✗ Branch 390 → 391 not taken.
✗ Branch 390 → 392 not taken.
✗ Branch 393 → 394 not taken.
✗ Branch 393 → 395 not taken.
✗ Branch 399 → 400 not taken.
✗ Branch 399 → 401 not taken.
✗ Branch 405 → 406 not taken.
✗ Branch 405 → 407 not taken.
✗ Branch 408 → 409 not taken.
✗ Branch 408 → 410 not taken.
✗ Branch 417 → 418 not taken.
✗ Branch 417 → 419 not taken.
✗ Branch 426 → 427 not taken.
✗ Branch 426 → 428 not taken.
✗ Branch 435 → 436 not taken.
✗ Branch 435 → 437 not taken.
✗ return ShaderResource{
541 // todo(Gustav): not really happy with sending "the same" argument twice, loaded_X.program and loaded_X.geom_layout
542
0/2
✗ Branch 136 → 137 not taken.
✗ Branch 136 → 440 not taken.
✗ .single_color_shader = LoadedShader_SingleColor{std::move(loaded_single_color.program), loaded_single_color.geom_layout, desc},
543 .depth_transform_uniform = LoadedShader_OnlyDepth{
544 ✗ TransformSource::uniform, std::move(loaded_depth_transform_uniform.program),
545 loaded_depth_transform_uniform.geom_layout,
546 desc
547
0/4
✗ Branch 141 → 142 not taken.
✗ Branch 141 → 431 not taken.
✗ Branch 214 → 215 not taken.
✗ Branch 214 → 216 not taken.
✗ },
548 .depth_transform_instanced_mat4 = LoadedShader_OnlyDepth{
549 TransformSource::instanced_mat4,
550 ✗ std::move(loaded_depth_transform_instanced_mat4.program),
551 loaded_depth_transform_instanced_mat4.geom_layout,
552 desc
553
0/4
✗ Branch 146 → 147 not taken.
✗ Branch 146 → 422 not taken.
✗ Branch 210 → 211 not taken.
✗ Branch 210 → 212 not taken.
✗ },
554
0/4
✗ Branch 151 → 152 not taken.
✗ Branch 151 → 413 not taken.
✗ Branch 206 → 207 not taken.
✗ Branch 206 → 208 not taken.
✗ .skybox_shader = LoadedShader_Skybox{std::move(loaded_skybox_shader.program), loaded_skybox_shader.geom_layout, desc},
555 .unlit_shader_container = LoadedShader_Unlit_Container{
556 .geom_layout = loaded_unlit.geom_layout,
557
0/2
✗ Branch 200 → 201 not taken.
✗ Branch 200 → 202 not taken.
✗ .default_shader = LoadedShader_Unlit{TransformSource::uniform, std::move(loaded_unlit.program), desc},
558
0/2
✗ Branch 197 → 198 not taken.
✗ Branch 197 → 199 not taken.
✗ .transparency_shader = LoadedShader_Unlit{TransformSource::uniform, std::move(loaded_unlit_transparency.program), desc}
559 },
560 .default_shader_container = LoadedShader_Default_Container{
561 .geom_layout = loaded_default.geom_layout,
562
0/2
✗ Branch 192 → 193 not taken.
✗ Branch 192 → 194 not taken.
✗ .default_shader = LoadedShader_Default{TransformSource::uniform, std::move(loaded_default.program), settings, desc},
563
0/2
✗ Branch 189 → 190 not taken.
✗ Branch 189 → 191 not taken.
✗ .transparency_shader = LoadedShader_Default{TransformSource::uniform, std::move(loaded_default_transparency.program), settings, desc},
564
0/2
✗ Branch 186 → 187 not taken.
✗ Branch 186 → 188 not taken.
✗ .default_shader_instance = LoadedShader_Default{TransformSource::instanced_mat4, std::move(loaded_default_instanced.program), settings, desc}
565 },
566 // .pp_invert = pp_invert,
567 // .pp_grayscale = pp_grayscale,
568 // .pp_damage = pp_damage,
569 // .pp_blurv = pp_blurv,
570 // .pp_blurh = pp_blurh,
571 .pp_realize = pp_realize,
572 .pp_extract = pp_extract,
573 .pp_ping = pp_ping
574 ✗ };
575
0/6
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 254 not taken.
✗ Branch 257 → 258 not taken.
✗ Branch 257 → 261 not taken.
✗ Branch 259 → 260 not taken.
✗ Branch 259 → 261 not taken.
✗ }
576
577
578
579 } // namespace eu::render
580