Diligent Engine
Loading...
Searching...
No Matches
Diligent::RadientVertexLayoutDesc Struct Reference

#include <RadientVertexLayout.h>

Public Attributes

const RadientVertexAttributeDescpAttributes = nullptr
Uint32 AttributeCount = 0
const RadientVertexBufferLayoutDescpBuffers = nullptr
Uint32 BufferCount = 0

Detailed Description

Description of dense, per-vertex byte streams.

Attributes may be interleaved or stored in separate logical buffers. The same vertex index selects the corresponding record in every buffer. Logical buffers may be views into the same allocation. Semantics must be unique across the layout. Attribute array order determines automatic offsets within each buffer; it does not determine shader input order. With explicit offsets, attribute array order does not affect the memory layout. Different semantics may alias the same bytes, for example two UV sets.

The layout describes memory organization without requiring any particular semantic, such as POSITION, or enforcing semantic-specific component formats. Source offsets and strides need not satisfy graphics API alignment rules or glTF's stride limits. A consumer may impose requirements for its particular use.

When a Radient object stores a layout, it copies the descriptor, both arrays, and all semantic strings before the API call returns. Asynchronous work uses this internal copy. The caller can modify or release the original descriptor, arrays, and strings as soon as the call returns.

The layout contains no vertex data pointers, vertex count, GPU resources, or renderer packing request. Automatic offsets and strides describe tightly packed input data; the renderer chooses its stored representation, which may use a different layout. An empty layout has both counts zero, and its array pointers are ignored. A nonempty layout requires both attributes and buffers. A zero-initialized descriptor represents an empty layout.

Member Data Documentation

◆ AttributeCount

Uint32 Diligent::RadientVertexLayoutDesc::AttributeCount = 0

Number of descriptors in pAttributes, not the number of vertices or scalar components. Must be positive for a nonempty layout. The default is zero; AttributeCount and BufferCount must either both be zero or both be positive.

◆ BufferCount

Uint32 Diligent::RadientVertexLayoutDesc::BufferCount = 0

Number of descriptors in pBuffers; valid attribute buffer indices are [0, BufferCount). Must be positive for a nonempty layout. Unreferenced buffers count toward this value. The default is zero; BufferCount and AttributeCount must either both be zero or both be positive.

◆ pAttributes

const RadientVertexAttributeDesc* Diligent::RadientVertexLayoutDesc::pAttributes = nullptr

Pointer to an array of AttributeCount attribute descriptors. Must be non-null when AttributeCount is nonzero; ignored for an empty layout. Every element must satisfy RadientVertexAttributeDesc's requirements, including a unique semantic and a valid index into pBuffers. Array order determines placement for attributes using RADIENT_VERTEX_AUTO_OFFSET. Attributes with explicit offsets keep their specified placement regardless of order. The default is nullptr.

Radient copies this array and its semantic strings when storing the layout. The caller can modify or release them after the API call returns.

◆ pBuffers

const RadientVertexBufferLayoutDesc* Diligent::RadientVertexLayoutDesc::pBuffers = nullptr

Pointer to an array of BufferCount logical buffer layout descriptors. Must be non-null when BufferCount is nonzero; ignored for an empty layout. An attribute's BufferIndex selects an element of this array. Every element specifies an explicit nonzero ByteStride or RADIENT_VERTEX_AUTO_STRIDE. Buffers referenced by no attribute require an explicit nonzero stride. The array describes logical streams, not physical allocations or resource bindings. The default is nullptr.

Radient copies this array when storing the layout. The caller can modify or release the original array after the API call returns.