30 lines
814 B
C++
30 lines
814 B
C++
|
|
#include "iwa/util/vertex_layout.hpp"
|
|
|
|
namespace iwa
|
|
{
|
|
mijin::Optional<VertexAttribute&> VertexLayout::findAttribute(VertexAttributeSemantic semantic, unsigned semanticIdx) noexcept
|
|
{
|
|
for (VertexAttribute& attribute : attributes)
|
|
{
|
|
if (attribute.semantic == semantic && attribute.semanticIdx == semanticIdx)
|
|
{
|
|
return attribute;
|
|
}
|
|
}
|
|
return mijin::NULL_OPTIONAL;
|
|
}
|
|
|
|
mijin::Optional<const VertexAttribute&> VertexLayout::findAttribute(VertexAttributeSemantic semantic, unsigned semanticIdx) const noexcept
|
|
{
|
|
for (const VertexAttribute& attribute : attributes)
|
|
{
|
|
if (attribute.semantic == semantic && attribute.semanticIdx == semanticIdx)
|
|
{
|
|
return attribute;
|
|
}
|
|
}
|
|
return mijin::NULL_OPTIONAL;
|
|
}
|
|
} // namespace iwa
|