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 | 3326 | for (uint32_t source = 0; source < kRenderVarSourceCount; ++source) { | |
| 63 | 3256 | if (kRenderVarSourceTokens[source] == name) { | |
| 64 | 432 | return RenderVarSource(source); | |
| 65 | } | ||
| 66 | } | ||
| 67 | 70 | return std::nullopt; | |
| 68 | } | ||
| 69 | |||
| 70 | #endif | ||
| 71 | |||
| 72 | } | ||
| 73 |