Skip to content

LiteFX::Rendering::Backends::VulkanVertexBufferLayoutBuilder::withAttribute

Adds an attribute to the vertex buffer layout.

Synopsis

Declared in <litefx/rendering_builders.hpp>

template<typename TSelf>
[[nodiscard]] constexpr TSelf&& withAttribute(this 
    TSelf&& self,
    BufferFormat format,
    UInt32 offset,
    AttributeSemantic semantic = AttributeSemantic::Arbitrary,
    UInt32 semanticIndex = 0);

Description

This overload implicitly determines the location based on the number of attributes already defined. It should only be used if all locations can be implicitly deducted.

Return Value

Note

The return value should not be discarded.

Parameters

NameDescription
formatThe format of the attribute.
offsetThe offset of the attribute within a buffer element.
semanticThe semantic of the attribute.
semanticIndexThe semantic index of the attribute.