stage/types.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | #pragma once | ||
| 3 | |||
| 4 | #include <array> | ||
| 5 | #include <cstddef> | ||
| 6 | #include <cstdint> | ||
| 7 | #include <map> | ||
| 8 | #include <memory> | ||
| 9 | #include <string> | ||
| 10 | #include <string_view> | ||
| 11 | #include <vector> | ||
| 12 | |||
| 13 | #include "chrono_batch_render/device/operation.h" | ||
| 14 | #include "chrono_batch_render/export.h" | ||
| 15 | #include "chrono_batch_render/stage/schema/ids.h" | ||
| 16 | #include "chrono_batch_render/stage/schema/types.h" | ||
| 17 | |||
| 18 | namespace chrono::batch_render { | ||
| 19 | |||
| 20 | 4 | struct ComposedWorldDesc { | |
| 21 | std::vector<uint32_t> worlds; | ||
| 22 | std::vector<Double3> offsets; | ||
| 23 | bool global = true; | ||
| 24 | bool stageLights = true; | ||
| 25 | }; | ||
| 26 | |||
| 27 | 12 | struct IdLabel { | |
| 28 | std::string path; | ||
| 29 | std::map<std::string, std::vector<std::string>> labels; | ||
| 30 | }; | ||
| 31 | |||
| 32 | using IdMap = std::map<std::array<uint32_t, 4>, IdLabel>; | ||
| 33 | using IdTexts = std::map<std::array<uint32_t, 4>, std::string>; | ||
| 34 | |||
| 35 | using Ordinal = uint64_t; | ||
| 36 | using FileBytes = std::shared_ptr<const std::vector<std::byte>>; | ||
| 37 | |||
| 38 | struct CHRONO_BATCH_RENDER_API CloneDesc { | ||
| 39 | bool moveSource = false; | ||
| 40 | bool attachable = false; | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct CHRONO_BATCH_RENDER_API BatchDesc { | ||
| 44 | bool attachable = false; | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct CHRONO_BATCH_RENDER_API PrimRange { | ||
| 48 | uint32_t firstPrim = kNoPrim; | ||
| 49 | uint32_t count = 0; | ||
| 50 | uint32_t copies = 0; | ||
| 51 | uint32_t firstWorld = kGlobalWorld; | ||
| 52 | uint32_t worldsPerCopy = 0; | ||
| 53 | |||
| 54 | 513 | uint32_t Index(uint32_t copy, uint32_t index) const { | |
| 55 | 513 | return firstPrim + copy * count + index; | |
| 56 | } | ||
| 57 | |||
| 58 | 10 | uint32_t Size() const { | |
| 59 | 10 | return count * copies; | |
| 60 | } | ||
| 61 | }; | ||
| 62 | |||
| 63 | 114 | struct CHRONO_BATCH_RENDER_API Box { | |
| 64 | Float3 lower; | ||
| 65 | Float3 upper; | ||
| 66 | }; | ||
| 67 | |||
| 68 | 15333 | struct CHRONO_BATCH_RENDER_API Snapshot { | |
| 69 | Ordinal ordinal = 0; | ||
| 70 | device::Operation ready; | ||
| 71 | uint64_t tables = 0; | ||
| 72 | std::shared_ptr<const void> pinned; | ||
| 73 | |||
| 74 | uint64_t Version() const; | ||
| 75 | uint64_t Version(std::string_view table) const; | ||
| 76 | }; | ||
| 77 | |||
| 78 | } | ||
| 79 |