Manages the layout of vertex attributes in a GPU buffer. More...
#include <Buffer.h>
Public Member Functions | |
BufferLayout (const std::initializer_list< BufferElement > &elements) | |
uint32_t | GetStride () const |
Gets the stride between vertices in bytes. | |
const std::vector< BufferElement > & | GetElements () const |
Gets the list of buffer elements. | |
std::vector< BufferElement >::iterator | begin () |
std::vector< BufferElement >::iterator | end () |
std::vector< BufferElement >::const_iterator | begin () const |
std::vector< BufferElement >::const_iterator | end () const |
Manages the layout of vertex attributes in a GPU buffer.
The BufferLayout class provides a way to describe how vertex data is organized in memory, enabling proper interpretation of vertex buffer data by the graphics pipeline. It:
Example usage:
|
inlinenodiscard |
Gets the list of buffer elements.
|
inlinenodiscard |
Gets the stride between vertices in bytes.
The stride is the total size of all elements in the layout, representing the distance in bytes between consecutive vertices.