chrono_batch_render/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
21 / 21
100.0%
Branches:
23 / 26
88.5%
Functions:
3 / 3, 2 excl
100.0%

scene/tables/table.h
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2 #pragma once
3
4 #include <cstddef>
5 #include <cstdint>
6 #include <span>
7
8 #include "chrono_batch_render/scene/records/render_tables.h"
9 #include "chrono_batch_render/stage/publish/header.h"
10 #include "chrono_batch_render/stage/publish/table.h"
11
12 namespace chrono::batch_render {
13
14 enum class TableId : uint32_t {
15 Transforms,
16 Imageables,
17 Meshes,
18 MeshPoints,
19 Points,
20 PointsMoved,
21 Curves,
22 CurvesMoved,
23 Tangents,
24 Textures,
25 Instances,
26 Slots,
27 Cameras,
28 Products,
29 };
30
31
13/16
✗ Branch 0 not taken.
✓ Branch 1 taken 2152 times.
✓ Branch 4 taken 353 times.
✓ Branch 7 taken 235 times.
✓ Branch 10 taken 235 times.
✓ Branch 13 taken 353 times.
✓ Branch 16 taken 353 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 235 times.
✓ Branch 21 taken 235 times.
✓ Branch 24 taken 353 times.
✓ Branch 27 taken 353 times.
✗ Branch 29 not taken.
✓ Branch 30 taken 235 times.
✓ Branch 32 taken 353 times.
✓ Branch 35 taken 353 times.
6634 class RenderTable : public Table {
32 public:
33 485 virtual void Describe(RenderTables&) const {}
34 };
35
36 799 class RenderHeader : public SnapshotHeader {
37 public:
38 1812 const RenderTables& Tables() const {
39
8/8
✓ Branch 1 taken 375 times.
✓ Branch 4 taken 372 times.
✓ Branch 7 taken 354 times.
✓ Branch 10 taken 354 times.
✓ Branch 13 taken 354 times.
✓ Branch 16 taken 1 time.
✓ Branch 19 taken 1 time.
✓ Branch 22 taken 1 time.
735 return m_tables;
40 }
41
42 10464 void Describe(const Table& table) override {
43
2/2
✓ Branch 0 taken 10393 times.
✓ Branch 1 taken 71 times.
10464 if (const auto* render = dynamic_cast<const RenderTable*>(&table)) {
44 10393 render->Describe(m_tables);
45 }
46 10464 }
47
48 1167 std::span<const std::byte> Seal(const AuthoredData& data, uint32_t worldCount) override {
49 1167 m_tables.prims = {.schema = data.prims.schema,
50 1167 .world = data.prims.world,
51 1167 .flags = data.prims.flags,
52 1167 .slots = data.prims.slots,
53 1167 .apis = data.prims.apis,
54 1167 .rows = data.rows,
55 1167 .parent = data.prims.parent,
56 1167 .count = data.primCount};
57 1167 m_tables.worldCount = worldCount;
58 1167 return std::as_bytes(std::span(&m_tables, 1));
59 }
60
61 private:
62 RenderTables m_tables{};
63 };
64
65 }
66