API Documentation
Public Member Functions | Public Attributes | List of all members
nkGraphics::MeshInputLayoutAttribute Struct Referencefinal

Describes an attribute in a mesh layout. More...

Public Member Functions

 MeshInputLayoutAttribute () noexcept=default
 
 MeshInputLayoutAttribute (nkMemory::StringView semanticName) noexcept
 
 MeshInputLayoutAttribute (nkMemory::StringView semanticName, FORMAT format) noexcept
 

Public Attributes

nkMemory::String _semanticName
 The semantic name to attach to the attribute. Used to link to the shader program code.
 
unsigned int _bufferSlot = 0u
 The buffer slot the attribute is to be found. This corresponds to the index of the vertex buffer linked to a mesh.
 
unsigned int _byteOffset = -1
 The offset required in the buffer before finding the first element for this attribute. If left to -1, offset will be computed from layout, assuming a tightly packed buffer.
 
unsigned int _instanceStepRate = 1u
 Instance step rate. If _granularity is ATTRIBUTE_GRNULARITY::PER_INSTANCE, then gives the number of instance to draw before stepping in the buffer by one element.
 
unsigned int _arraySize = 1u
 Number of nkFloat4 the attribute covers. A size of 1 corresponds to a nkFloat4, while 4 uses 4 of them, which can be interpreted as a nkFloat4x4.
 
FORMAT _format = R32G32B32A32_FLOAT
 Data format.
 
ATTRIBUTE_GRANULARITY _granularity = ATTRIBUTE_GRANULARITY::PER_VERTEX
 Data granularity.
 

Detailed Description

Describes an attribute in a mesh layout.

Constructor & Destructor Documentation

◆ MeshInputLayoutAttribute() [1/3]

nkGraphics::MeshInputLayoutAttribute::MeshInputLayoutAttribute ( )
defaultnoexcept

Default constructor.

◆ MeshInputLayoutAttribute() [2/3]

nkGraphics::MeshInputLayoutAttribute::MeshInputLayoutAttribute ( nkMemory::StringView  semanticName)
noexcept

Named constructor.

Parameters
semanticNameThe semantic name to use.

◆ MeshInputLayoutAttribute() [3/3]

nkGraphics::MeshInputLayoutAttribute::MeshInputLayoutAttribute ( nkMemory::StringView  semanticName,
FORMAT  format 
)
noexcept

Named constructor, with format.

Parameters
semanticNameThe semantic name to use.
formatThe format of the attribute to create.

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