chrono_batch_render/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
5 / 5
100.0%
Branches:
4 / 4
100.0%
Functions:
1 / 1
100.0%

scene/records/render_vars.h
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2 #pragma once
3
4 #include "chrono_batch_render/stage/schema/types.h"
5
6 #ifndef __SLANG__
7 #include <optional>
8 #include <string_view>
9 #endif
10
11 namespace chrono::batch_render {
12
13 CHRONO_BATCH_RENDER_ENUM(RenderVarSource) {
14 LdrColor,
15 HdrColor,
16 DistanceToCamera,
17 DistanceToImagePlane,
18 NonStableInstanceSegmentation,
19 Normal,
20 DiffuseAlbedo,
21 SemanticSegmentation,
22 SemanticIdMap,
23 SemanticInstanceSegmentation,
24 StableIdSegmentation,
25 StableIdMap,
26 Intensity,
27 PointCloud,
28 RadialVelocity,
29 InstanceId,
30 InstancerStableId,
31 ElectronRate,
32 NormalizedDepth,
33 };
34
35 static const uint kRenderVarSourceCount = 19;
36
37 #ifndef __SLANG__
38
39 inline constexpr std::string_view kRenderVarSourceTokens[kRenderVarSourceCount] = {
40 "LdrColor",
41 "HdrColor",
42 "DistanceToCamera",
43 "DistanceToImagePlane",
44 "NonStableInstanceSegmentation",
45 "Normal",
46 "DiffuseAlbedo",
47 "SemanticSegmentation",
48 "SemanticIdMap",
49 "SemanticInstanceSegmentation",
50 "StableIdSegmentation",
51 "StableIdMap",
52 "Intensity",
53 "PointCloud",
54 "RadialVelocity",
55 "InstanceId",
56 "InstancerStableId",
57 "ElectronRate",
58 "NormalizedDepth",
59 };
60
61 502 inline std::optional<RenderVarSource> FindRenderVarSource(std::string_view name) {
62
2/2
✓ Branch 0 taken 3256 times.
✓ Branch 1 taken 70 times.
3326 for (uint32_t source = 0; source < kRenderVarSourceCount; ++source) {
63
2/2
✓ Branch 0 taken 432 times.
✓ Branch 1 taken 2824 times.
3256 if (kRenderVarSourceTokens[source] == name) {
64 432 return RenderVarSource(source);
65 }
66 }
67 70 return std::nullopt;
68 }
69
70 #endif
71
72 }
73