RadientMeshAssetManager.cpp creates an element for every slot up to GetVertexBufferCount():
for (Uint32 BufferIndex = 0; BufferIndex < VertexBufferCount; ++BufferIndex)
LayoutKey.Elements.emplace_back(
VertexSource.GetVertexStride(BufferIndex),
BIND_VERTEX_BUFFER);
But the vertex source intentionally permits inactive gaps. Inactive buffers keep stride and data size zero.
This is not just an exotic custom-layout case. Diligent’s default layout uses:
Buffer 0: POSITION, NORMAL, TEXCOORD_0
Buffer 1: JOINTS_0, WEIGHTS_0
Buffer 2: TEXCOORD_1
Buffer 3: COLOR_0
Buffer 4: TANGENT
Therefore, an ordinary static mesh containing POSITION + COLOR_0 produces logical slots:
Likewise, POSITION + TEXCOORD_1 produces:
The default slot assignment is visible in Diligent’s official DefaultVertexAttributes.
A zero element size is invalid for VertexPool. Its allocation path computes buffer capacity by dividing a buffer size by m_Elements[i].Size, so a zero-sized element can become a release-build division by zero.
RadientMeshAssetManager.cpp creates an element for every slot up to GetVertexBufferCount():
But the vertex source intentionally permits inactive gaps. Inactive buffers keep stride and data size zero.
This is not just an exotic custom-layout case. Diligent’s default layout uses:
Therefore, an ordinary static mesh containing POSITION + COLOR_0 produces logical slots:
Likewise, POSITION + TEXCOORD_1 produces:
The default slot assignment is visible in Diligent’s official
DefaultVertexAttributes.A zero element size is invalid for
VertexPool. Its allocation path computes buffer capacity by dividing a buffer size bym_Elements[i].Size, so a zero-sized element can become a release-build division by zero.