Class MeshletBuffer
Namespace: ValveResourceFormat.Blocks
Assembly: ValveResourceFormat.dll
"MSLT" block. Holds packed per-meshlet local index data. Each meshlet vertex is one entry, so a meshlet spans vertexCount consecutive entries and the meshlets are concatenated.
public class MeshletBuffer : RawBinaryInheritance
object ← Block ← RawBinary ← MeshletBuffer
Inherited Members
RawBinary.Read(BinaryReader), RawBinary.Serialize(Stream), RawBinary.WriteText(IndentedTextWriter), Block.Type, Block.Offset, Block.Size, Block.Resource, Block.Read(BinaryReader), Block.ToString(), Block.WriteText(IndentedTextWriter), Block.Serialize(Stream)
Extension Methods
ResourceDataExtensions.AsKeyValueCollection(Block)
Remarks
A mesh shader transforms each meshlet vertex once, then emits the local index buffer (0..vertexCount-1) as primitives over those vertices. A vertex's attributes are fetched from MVTX at index (m_nVertexOffset + localIndex). MIDX, the global index buffer, is only used by the classic vertex/fragment draw path; the meshlet path does not need it.
Properties
Type
Gets the block type.
public override BlockType Type { get; }Property Value
Methods
DecodeMeshlet(int, int, int, Span<int>, Span<int>)
Decodes a single meshlet into its vertex list and its local triangle index buffer.
public void DecodeMeshlet(int entryOffset, int vertexCount, int triangleCount, Span<int> vertices, Span<int> indices)Parameters
entryOffset int
Uint offset of the meshlet's entries: the summed m_nVertexCount of preceding meshlets (distinct from m_nVertexOffset).
vertexCount int
Number of vertices/entries in the meshlet (its m_nVertexCount).
triangleCount int
Number of triangles in the meshlet (its m_nTriangleCount).
Receives vertexCount values: the raw per-entry 14-bit field.
Receives triangleCount * 3 meshlet-local vertex indices.
Remarks
6-bit references over a 64-entry sliding window: a reference of (maxIntroduced + 1) & 63 introduces the next vertex, any other value reuses one already in the window. Lets meshlets exceed 64 vertices.

