Skip to main content

UniformMappingsComponent.ixx File

Component that stores semantic-to-uniform-name mappings for shader usage. More...

Included Headers

#include <string> #include <array> #include <cstddef> #include <utility> #include <cassert> #include <helios.engine.rendering.shader.types.UniformMapping> #include <helios.engine.rendering.shader.types.UniformSemantics>

Namespaces Index

namespacehelios
namespaceengine
namespacerendering
namespaceshader
namespacecomponents

Classes Index

structUniformMappingsComponent<TOwnerHandle, TUniformScope>

Stores uniform names indexed by UniformSemantics. More...

Description

Component that stores semantic-to-uniform-name mappings for shader usage.

File Listing

The file content with the documentation metadata removed is:

1
5module;
6
7#include <string>
8#include <array>
9#include <cstddef>
10#include <utility>
11#include <cassert>
12
13export module helios.engine.rendering.shader.components.UniformMappingsComponent;
14
15import helios.engine.rendering.shader.types.UniformSemantics;
16import helios.engine.rendering.shader.types.UniformMapping;
17
20
25 template<typename TOwnerHandle, typename TUniformScope>
27
31 static constexpr auto UniformSemanticsCount = static_cast<std::size_t>(
32 std::to_underlying(UniformSemantics::size_)
33 );
34
38 std::array<std::string, UniformSemanticsCount> mappings{};
39
40 public:
49 template<typename ...TMappings>
50 requires (std::same_as<std::remove_cvref_t<TMappings>, UniformMapping> && ...)
52 {
53 (assert(std::to_underlying(mapping.semantics) < UniformSemanticsCount
54 && "UniformSemantics value out of range in UniformMappingsComponent constructor"), ...);
55
56 ((mappings[std::to_underlying(mapping.semantics)] = std::move(mapping.name)), ...);
57 }
58
59
60
61 };
62
63}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.