Skip to main content

MeshUploadSystem.ixx File

Collects active shader resources and queues batch compile commands. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine
namespacerendering
namespacemesh
namespacesystems

Classes Index

classMeshUploadSystem<THandle, TCommandBuffer, TCapacity>

Description

Collects active shader resources and queues batch compile commands.

File Listing

The file content with the documentation metadata removed is:

1
5module;
6
7#include <vector>
9
10export module helios.engine.rendering.mesh.systems.MeshUploadSystem;
11
12import helios.engine.rendering.mesh.concepts;
13import helios.engine.runtime.messaging.command.NullCommandBuffer;
14import helios.engine.runtime.messaging.command.concepts.IsCommandBufferLike;
15import helios.engine.rendering.mesh.components.MeshDataComponent;
16import helios.engine.rendering.mesh.components.MeshUploadRequestComponent;
17import helios.engine.rendering.mesh.commands.MeshBatchUploadCommand;
18import helios.engine.runtime.world.tags.SystemRole;
19import helios.engine.runtime.world.UpdateContext;
20
21import helios.ecs.components.Active;
22
23using namespace helios::engine::rendering::mesh::concepts;
29using namespace helios::engine::runtime::messaging::command::concepts;
30using namespace helios::ecs::components;
32
33
34 template<typename THandle, typename TCommandBuffer = NullCommandBuffer, size_t TCapacity = DEFAULT_MESH_POOL_CAPACITY>
37
38 std::vector<THandle> meshHandles_;
39
40 size_t capacity_;
41
42 public:
43
46
47 explicit MeshUploadSystem(size_t capacity = TCapacity) : capacity_(capacity) {
48 meshHandles_.reserve(capacity);
49 }
50
57
58 for (auto [entity, mdc, murc, ac] : updateContext.view<
63 >().whereEnabled()) {
64 meshHandles_.push_back(entity.handle());
65 }
66
67 cmdBuffer.template add<MeshBatchUploadCommand<THandle>>(std::move(meshHandles_));
68
69 meshHandles_.clear();
70 meshHandles_.reserve(capacity_);
71
72
73 }
74
75 };
76
77
78
79}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.