./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
0 / 26
0.0%
Branches:
0 / 58
0.0%
Functions:
0 / 3
0.0%

libs/render/src/eu/render/renderer.pimpl.cc
Line Branch Exec Source
1 #include "eu/log/log.h"
2
3 #include "eu/render/fullscreen.h"
4 #include "eu/render/renderer.pimpl.h"
5
6 #include "glad/glad.h"
7 #include "eu/render/shader_resource.h"
8
9 namespace eu::render
10 {
11
12
13 ✗ std::string string_from_gl_bytes(const GLubyte* bytes)
14 {
15
0/2
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 9 not taken.
✗ return reinterpret_cast<const char*>(bytes);
16 }
17
18 ✗ CameraUniformBuffer make_camera_uniform_buffer_desc()
19 {
20 ✗ CameraUniformBuffer camera_uniform_buffer;
21
22 {
23 ✗ core::UniformBufferCompiler compiler;
24
0/4
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 31 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 29 not taken.
✗ compiler.add(&camera_uniform_buffer.clip_from_view_uni, core::UniformType::mat4, "u_clip_from_view");
25
0/4
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 37 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 35 not taken.
✗ compiler.add(&camera_uniform_buffer.view_from_world_uni, core::UniformType::mat4, "u_view_from_world");
26
0/4
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 43 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 41 not taken.
✗ camera_uniform_buffer.setup = compiler.compile("Camera", 0);
27 ✗ }
28
29
0/2
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 51 not taken.
✗ camera_uniform_buffer.buffer = std::make_unique<UniformBuffer>(USE_DEBUG_LABEL_MANY("camera uniform buffer") camera_uniform_buffer.setup);
30
31 ✗ return camera_uniform_buffer;
32 ✗ }
33
34 ✗ RendererPimpl::RendererPimpl(State* new_states, const Assets& assets, const RenderSettings& set, const FullScreenGeom& full_screen)
35 ✗ : states(new_states)
36 ✗ , camera_uniform_buffer(make_camera_uniform_buffer_desc())
37
0/2
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 73 not taken.
✗ , shaders_resources(load_shaders(assets, camera_uniform_buffer, set, full_screen))
38
0/2
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 71 not taken.
✗ , full_screen_geom(full_screen.geom)
39 {
40
0/4
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 66 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 66 not taken.
✗ const auto vendor = string_from_gl_bytes(glGetString(GL_VENDOR));
41
0/4
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 64 not taken.
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 64 not taken.
✗ const auto renderer = string_from_gl_bytes(glGetString(GL_RENDERER));
42
0/4
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 62 not taken.
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 62 not taken.
✗ const auto version = string_from_gl_bytes(glGetString(GL_VERSION));
43
0/4
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 60 not taken.
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 60 not taken.
✗ const auto shading_language_version = string_from_gl_bytes(glGetString(GL_SHADING_LANGUAGE_VERSION));
44
0/4
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 58 not taken.
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 58 not taken.
✗ const auto extensions = string_from_gl_bytes(glGetStringi(GL_EXTENSIONS, 0));
45
46
0/6
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 56 not taken.
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 41 not taken.
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 39 not taken.
✗ LOG_INFO("vendor {}, renderer {}", vendor.c_str(), renderer.c_str());
47
0/6
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 56 not taken.
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 47 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 45 not taken.
✗ LOG_INFO("version {} (glsl {})", version.c_str(), shading_language_version.c_str());
48
0/6
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 56 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 53 not taken.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 51 not taken.
✗ LOG_INFO("extensions {}", extensions.c_str());
49 ✗ }
50
51
52 } // namespace eu::render
53