Class VertexInputLayout
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Interleaved vertex layout of handbuilt geometry, held as the same input layout fields a mesh carries. Element order is buffer order, and offsets pack in declaration order unless given explicitly.
public sealed class VertexInputLayoutInheritance
Constructors
VertexInputLayout(int, params VertexAttribute[])
Initializes a vertex format from a stride and its attributes in buffer order.
public VertexInputLayout(int stride, params VertexAttribute[] elements)Parameters
stride int
elements VertexAttribute[]
VertexInputLayout(int, string[], VertexAttribute[])
Initializes a vertex format holding only some of the attributes its shader declares.
public VertexInputLayout(int stride, string[] declaredNames, VertexAttribute[] elements)Parameters
stride int
Size in bytes of one vertex.
declaredNames string[]
Every attribute name the shader declares, combo-disabled ones included.
elements VertexAttribute[]
The attributes this buffer holds, in buffer order.
Properties
Stride
Gets the size in bytes of a single vertex.
public int Stride { get; }Property Value
Methods
CreateVertexArray(string, int, int, int)
Creates a VAO binding one vertex buffer. An index buffer of 0 means non-indexed.
public int CreateVertexArray(string debugLabel, int vertexBuffer, int indexBuffer = 0, int instanceDivisor = 0)Parameters
debugLabel string
Name the VAO is labelled with.
vertexBuffer int
Buffer every attribute reads from.
indexBuffer int
Index buffer, or 0 to draw non-indexed.
instanceDivisor int
Instances each set of attributes covers, or 0 for one set per vertex.
Returns
Fields()
This format as input layout fields, for the upload path.
public VBIB.RenderInputLayoutField[] Fields()Returns
FromStruct<TVertex>(string[]?)
Derives the format of a vertex struct from its fields.
public static VertexInputLayout FromStruct<TVertex>(string[]? declaredNames = null) where TVertex : structParameters
declaredNames string[]?
As the constructor taking the same, or null for the struct's own fields.
Returns
Type Parameters
TVertex
The vertex struct.

