Skip to main content

ShaderCompileSystem.ixx File

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

Included Headers

Namespaces Index

namespacehelios
namespaceengine
namespacerendering
namespaceshader
namespacesystems

Classes Index

classShaderCompileSystem<THandle, TCommandBuffer, TCapacity>

System that batches shader compile requests for active shader entities. More...

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 <span>
8#include <vector>
9#include <cstddef>
11
12export module helios.engine.rendering.shader.systems.ShaderCompileSystem;
13
14import helios.engine.runtime.messaging.command.RenderCommandBuffer;
15import helios.engine.runtime.messaging.command.NullCommandBuffer;
16
17import helios.engine.runtime.world.UpdateContext;
18import helios.engine.runtime.world.tags.SystemRole;
19
20import helios.engine.rendering.shader.components;
21import helios.engine.rendering.shader.concepts;
22import helios.engine.rendering.shader.commands;
23
24import helios.engine.runtime.messaging.command.concepts.IsCommandBufferLike;
25
26import helios.ecs.components;
27
32using namespace helios::engine::runtime::messaging::command::concepts;
35using namespace helios::ecs::components;
36using namespace helios::engine::rendering::shader::concepts;
38
46 template<typename THandle, typename TCommandBuffer = NullCommandBuffer, size_t TCapacity = DEFAULT_SHADER_POOL_CAPACITY>
49
50 std::vector<THandle> shaderHandles_;
51
52 size_t capacity_;
53
54 public:
55
58
59 explicit ShaderCompileSystem(size_t capacity = TCapacity) : capacity_(capacity) {
60 shaderHandles_.reserve(capacity);
61 }
62
69
70 for (auto [entity, scc, ac] : updateContext.view<
74 >().whereEnabled()) {
75 shaderHandles_.push_back(entity.handle());
76 }
77
78 cmdBuffer.template add<ShaderBatchCompileCommand<THandle>>(std::move(shaderHandles_));
79
80 shaderHandles_.clear();
81 shaderHandles_.reserve(capacity_);
82
83
84 }
85
86 };
87
88
89
90}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.