Skip to main content

VertexAttributeLayoutComponent Class Template

Stores a semantic-indexed set of vertex attribute layouts. More...

Declaration

template <typename TOwnerHandle, typename TVertexInput> class helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent<TOwnerHandle, TVertexInput> { ... }

Public Constructors Index

template <typename ... TAttributes>
VertexAttributeLayoutComponent (TAttributes &&... layout)

Constructs the component from one or more layout descriptors. More...

Public Member Functions Index

template <typename TOwnerHandle, typename TVertexInput>
const VertexAttributeLayout *layout (const VertexAttributeSemantics semantics) const noexcept

Returns the layout for a semantic, or nullptr if not active. More...

template <typename TOwnerHandle, typename TVertexInput>
const auto &layouts () const noexcept

Returns the internal semantic-indexed layout storage. More...

template <typename TOwnerHandle, typename TVertexInput>
const auto &active () const noexcept

Returns the semantic activity mask. More...

Private Member Functions Index

template <typename TOwnerHandle, typename TVertexInput>
voidset (VertexAttributeLayout layout)

Registers or replaces one layout entry and marks it active. More...

Private Member Attributes Index

template <typename TOwnerHandle, typename TVertexInput>
std::array< VertexAttributeLayout, VertexAttributeSemanticsCount >layouts_ {}

Semantic-indexed storage for attribute layouts. More...

template <typename TOwnerHandle, typename TVertexInput>
std::bitset< VertexAttributeSemanticsCount >active_

Activity mask indicating which semantic slots are populated. More...

Private Static Attributes Index

template <typename TOwnerHandle, typename TVertexInput>
static constexpr autoVertexAttributeSemanticsCount = ...

Number of semantic slots available in the layout table. More...

Description

Stores a semantic-indexed set of vertex attribute layouts.

Template Parameters
TOwnerHandle

Owning entity handle type.

TVertexInput

Marker type describing the input stepping domain.

Definition at line 32 of file VertexAttributeLayoutComponent.ixx.

Public Constructors

VertexAttributeLayoutComponent()

template <typename ... TAttributes>
helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent< TOwnerHandle, TVertexInput >::VertexAttributeLayoutComponent (TAttributes &&... layout)
inline explicit

Constructs the component from one or more layout descriptors.

Template Parameters
TAttributes

Parameter pack of VertexAttributeLayout values.

Parameters
layout

Layout descriptors to register as active.

Definition at line 78 of file VertexAttributeLayoutComponent.ixx.

79 {
80 (set(std::forward<TAttributes>(layout)), ...);
81 }

Reference helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent< TOwnerHandle, TVertexInput >::layout.

Public Member Functions

active()

template <typename TOwnerHandle, typename TVertexInput>
const auto & helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent< TOwnerHandle, TVertexInput >::active ()
inline noexcept

Returns the semantic activity mask.

Returns

Bitset with one bit per VertexAttributeSemantics slot.

Definition at line 114 of file VertexAttributeLayoutComponent.ixx.

114 [[nodiscard]] const auto& active() const noexcept {
115 return active_;
116 }

layout()

template <typename TOwnerHandle, typename TVertexInput>
const VertexAttributeLayout * helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent< TOwnerHandle, TVertexInput >::layout (const VertexAttributeSemantics semantics)
inline noexcept

Returns the layout for a semantic, or nullptr if not active.

Parameters
semantics

Semantic to query.

Returns

Pointer to layout if active; otherwise nullptr.

Definition at line 90 of file VertexAttributeLayoutComponent.ixx.

90 [[nodiscard]] const VertexAttributeLayout* layout(const VertexAttributeSemantics semantics) const noexcept {
91
92 const auto idx = static_cast<std::size_t>(std::to_underlying(semantics));
93 if (!active_.test(idx)) {
94 return nullptr;
95 }
96
97 return &layouts_[idx];
98 }

Reference helios::engine::rendering::registerComponents.

Referenced by helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent< TOwnerHandle, TVertexInput >::VertexAttributeLayoutComponent.

layouts()

template <typename TOwnerHandle, typename TVertexInput>
const auto & helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent< TOwnerHandle, TVertexInput >::layouts ()
inline noexcept

Returns the internal semantic-indexed layout storage.

Returns

Read-only reference to all layout slots.

Definition at line 105 of file VertexAttributeLayoutComponent.ixx.

105 [[nodiscard]] const auto& layouts() const noexcept {
106 return layouts_;
107 }

Private Member Functions

set()

template <typename TOwnerHandle, typename TVertexInput>
void helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent< TOwnerHandle, TVertexInput >::set (VertexAttributeLayout layout)
inline

Registers or replaces one layout entry and marks it active.

Parameters
layout

Layout descriptor to store.

Definition at line 56 of file VertexAttributeLayoutComponent.ixx.

57#if HELIOS_DEBUG
58 assert(std::to_underlying(layout.attribute.semantics) < VertexAttributeSemanticsCount
59 && "VertexAttributeSemantics value out of range in VertexAttributeLayoutComponent constructor");
60#endif
61
62 const auto idx = static_cast<std::size_t>(std::to_underlying(layout.attribute.semantics));
63
64 layouts_[idx] = std::move(layout);
65 active_.set(idx);
66 }

Private Member Attributes

active_

template <typename TOwnerHandle, typename TVertexInput>
std::bitset<VertexAttributeSemanticsCount> helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent< TOwnerHandle, TVertexInput >::active_

Activity mask indicating which semantic slots are populated.

Definition at line 49 of file VertexAttributeLayoutComponent.ixx.

49 std::bitset<VertexAttributeSemanticsCount> active_;

layouts_

template <typename TOwnerHandle, typename TVertexInput>
std::array<VertexAttributeLayout, VertexAttributeSemanticsCount> helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent< TOwnerHandle, TVertexInput >::layouts_ {}

Semantic-indexed storage for attribute layouts.

Definition at line 44 of file VertexAttributeLayoutComponent.ixx.

44 std::array<VertexAttributeLayout, VertexAttributeSemanticsCount> layouts_{};

Private Static Attributes

VertexAttributeSemanticsCount

template <typename TOwnerHandle, typename TVertexInput>
constexpr auto helios::engine::rendering::mesh::components::VertexAttributeLayoutComponent< TOwnerHandle, TVertexInput >::VertexAttributeSemanticsCount
constexpr static

Number of semantic slots available in the layout table.

Initialiser
= static_cast<std::size_t>( std::to_underlying(VertexAttributeSemantics::size_) )

Definition at line 37 of file VertexAttributeLayoutComponent.ixx.

37 static constexpr auto VertexAttributeSemanticsCount = static_cast<std::size_t>(

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.