Diligent::LayoutElement struct

Description of a single element of the input layout.

Constructors, destructors, conversion operators

LayoutElement(Uint32 _InputIndex, Uint32 _BufferSlot, Uint32 _NumComponents, VALUE_TYPE _ValueType, Bool _IsNormalized = LayoutElement{}.IsNormalized, Uint32 _RelativeOffset = LayoutElement{}.RelativeOffset, Uint32 _Stride = LayoutElement{}.Stride, INPUT_ELEMENT_FREQUENCY _Frequency = LayoutElement{}.Frequency, Uint32 _InstanceDataStepRate = LayoutElement{}.InstanceDataStepRate) noexcept
Initializes the structure.
LayoutElement(const char* _HLSLSemantic, Uint32 _InputIndex, Uint32 _BufferSlot, Uint32 _NumComponents, VALUE_TYPE _ValueType, Bool _IsNormalized = LayoutElement{}.IsNormalized, Uint32 _RelativeOffset = LayoutElement{}.RelativeOffset, Uint32 _Stride = LayoutElement{}.Stride, INPUT_ELEMENT_FREQUENCY _Frequency = LayoutElement{}.Frequency, Uint32 _InstanceDataStepRate = LayoutElement{}.InstanceDataStepRate) noexcept
Initializes the structure.
LayoutElement(Uint32 _InputIndex, Uint32 _BufferSlot, Uint32 _NumComponents, VALUE_TYPE _ValueType, Bool _IsNormalized, INPUT_ELEMENT_FREQUENCY _Frequency, Uint32 _InstanceDataStepRate = LayoutElement{}.InstanceDataStepRate) noexcept
Initializes the structure.

Public variables

const char* HLSLSemantic
HLSL semantic. Default value ("ATTRIB") allows HLSL shaders to be converted to GLSL and used in OpenGL backend as well as compiled to SPIRV and used in Vulkan backend. Any value other than default will only work in Direct3D11 and Direct3D12 backends.
Uint32 InputIndex
Input index of the element that is specified in the vertex shader. In Direct3D11 and Direct3D12 backends this is the semantic index.
Uint32 BufferSlot
Buffer slot index that this element is read from.
Uint32 NumComponents
Number of components in the element. Allowed values are 1, 2, 3, and 4.
VALUE_TYPE ValueType
Type of the element components, see Diligent::VALUE_TYPE for details.
Bool IsNormalized
For signed and unsigned integer value types (VT_INT8, VT_INT16, VT_INT32, VT_UINT8, VT_UINT16, VT_UINT32) indicates if the value should be normalized to [-1,+1] or [0, 1] range respectively. For floating point types (VT_FLOAT16 and VT_FLOAT32), this member is ignored.
Uint32 RelativeOffset
Relative offset, in bytes, to the element bits. If this value is set to LAYOUT_ELEMENT_AUTO_OFFSET (default value), the offset will be computed automatically by placing the element right after the previous one.
Uint32 Stride
Stride, in bytes, between two elements, for this buffer slot. If this value is set to LAYOUT_ELEMENT_AUTO_STRIDE, the stride will be computed automatically assuming that all elements in the same buffer slot are packed one after another. If the buffer slot contains multiple layout elements, they all must specify the same stride or use LAYOUT_ELEMENT_AUTO_STRIDE value.
Uint32 InstanceDataStepRate
The number of instances to draw using the same per-instance data before advancing in the buffer by one element.