UniformValueMap.ixx File
Mapping of uniform names to values used by shader programs. More...
Included Headers
#include <array>
#include <optional>
#include <variant>
#include <helios.math.types>
#include <helios.rendering.shader.UniformSemantics>
Namespaces Index
| namespace | helios |
| namespace | rendering |
|
Graphics rendering infrastructure. More... | |
| namespace | shader |
Classes Index
| class | UniformValueMap |
|
Maps uniform semantics to their values for shader parameter binding. More... | |
Description
Mapping of uniform names to values used by shader programs.
File Listing
The file content with the documentation metadata removed is:
17export namespace helios::rendering::shader {
25 using UniformValue = std::variant<
68 * which allows for better handling of assigning uniforms: per-frame values change once per frame,
71 class UniformValueMap {
78 std::array<std::optional<UniformValue>, std::to_underlying(UniformSemantics::size_)> map_;
85 ~UniformValueMap() = default;
92 UniformValueMap() = default;
100 void set(UniformSemantics uniformSemantics, const helios::math::mat4f& mat4f) noexcept {
101 map_[std::to_underlying(uniformSemantics)].emplace(mat4f);
112 [[nodiscard]] const float* mat4f_ptr(UniformSemantics uniformSemantics) const noexcept {
122 return helios::math::value_ptr(*it);
140 [[nodiscard]] const helios::math::mat4f* mat4f(UniformSemantics uniformSemantics) const noexcept {
163 void set(UniformSemantics uniformSemantics, const helios::math::vec4f& vec4f) noexcept {
174 [[nodiscard]] const float* vec4f_ptr(UniformSemantics uniformSemantics) const noexcept {
184 return helios::math::value_ptr(*it);
199 void set(UniformSemantics uniformSemantics, int value) noexcept {
209 void set(UniformSemantics uniformSemantics, float value) noexcept {
224 [[nodiscard]] const float* float_ptr(UniformSemantics uniformSemantics) const noexcept {
249 [[nodiscard]] const int* int_ptr(UniformSemantics uniformSemantics) const noexcept {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.