SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::render::BufferAttribute Class Referencefinal

Stores metadata about a buffer attribute, member or field of a descriptor or buffer. More...

#include <Buffer.h>

Classes

struct  Impl
 

Public Member Functions

 BufferAttribute () noexcept
 Initializes an empty buffer attribute.
 
 BufferAttribute (unsigned int location, unsigned int offset, BufferFormat format, AttributeSemantic semantic, unsigned int semantic_index) noexcept
 Initializes a new buffer attribute with the specified parameters.
 
 BufferAttribute (const BufferAttribute &other)=delete
 
 BufferAttribute (BufferAttribute &&other) noexcept
 
BufferAttributeoperator= (const BufferAttribute &other)=delete
 
BufferAttributeoperator= (BufferAttribute &&other) noexcept
 
unsigned int location () const noexcept
 Gets the location the buffer attribute is bound to.
 
BufferFormat format () const noexcept
 Gets the format of the buffer attribute.
 
unsigned int offset () const noexcept
 Gets the offset of the buffer attribute relative to the start of the buffer.
 
AttributeSemantic semantic () const noexcept
 Gets the semantic of the buffer attribute.
 
unsigned int semanticIndex () const noexcept
 Gets the semantic index of the buffer attribute.
 

Detailed Description

Stores metadata about a buffer attribute, member or field of a descriptor or buffer.

Constructor & Destructor Documentation

◆ BufferAttribute()

spark::render::BufferAttribute::BufferAttribute ( unsigned int location,
unsigned int offset,
BufferFormat format,
AttributeSemantic semantic,
unsigned int semantic_index )
noexcept

Initializes a new buffer attribute with the specified parameters.

Parameters
locationThe location the buffer attribute is bound to.
offsetThe offset of the buffer attribute relative to the start of the buffer.
formatThe format of the buffer attribute.
semanticThe semantic of the buffer attribute.
semantic_indexThe semantic index of the buffer attribute.

Member Function Documentation

◆ format()

BufferFormat spark::render::BufferAttribute::format ( ) const
nodiscardnoexcept

Gets the format of the buffer attribute.

Returns
A BufferFormat representing the format of the buffer attribute.

◆ location()

unsigned spark::render::BufferAttribute::location ( ) const
nodiscardnoexcept

Gets the location the buffer attribute is bound to.

Returns
The location the buffer attribute is bound to.
Note
Locations can only be specified with Vulkan, any other backend will ignore this value and use their implicitly generated locations.

◆ offset()

unsigned spark::render::BufferAttribute::offset ( ) const
nodiscardnoexcept

Gets the offset of the buffer attribute relative to the start of the buffer.

Returns
The offset of the buffer attribute relative to the start of the buffer.

◆ semantic()

AttributeSemantic spark::render::BufferAttribute::semantic ( ) const
nodiscardnoexcept

Gets the semantic of the buffer attribute.

Returns
A AttributeSemantic representing the semantic of the buffer attribute.
Note
Semantics are only used in DirectX and HLSL.

◆ semanticIndex()

unsigned spark::render::BufferAttribute::semanticIndex ( ) const
nodiscardnoexcept

Gets the semantic index of the buffer attribute.

Returns
The semantic index of the buffer attribute.
Note
Semantic indices are only used in DirectX and HLSL.