VertexElements

Description

[ShutdownSurvive]
sealed class Tinman.Terrain.Rendering.VertexElements

Derived from

IEquatable<VertexElements>

An immutable list of vertex elements.

Public / Constants

Empty


public static readonly attribute Empty → (VertexElements)

An empty list of vertex elements.

Public / Constructors

Vertex​Elements

2 overloads


public constructor VertexElements1 → (1)

element in : VertexElement

[not-null]
The vertex element to wrap.

Creates a new instance of VertexElements.


public constructor VertexElements2 → (4)

usage in : VertexElementUsage

Usage of first vertex format element.

type in : VertexElementType

Data type of first vertex format element.

count in : int32

[0..4]
Number of data values in first vertex format element.

flags opt : VertexElementFlags = VertexElementFlags.None

Additional vertex element flags.

Creates a new instance of VertexElements.

Public / Methods

Add

3 overloads


public method Add1 → (1)

element in : VertexElement

[not-null]
The vertex format element to append.

returns → VertexElements

The resulting vertex elements.

Appends the given vertex element using SizeCompact as VertexElement.Offset and returns the resulting VertexElements object.


public method Add2 → (1)

elements in : VertexElements

[not-null]
The vertex format elements to append.

returns → VertexElements

The resulting vertex elements.

Appends the given vertex elements using SizeCompact as respective VertexElement.Offset and returns the resulting VertexElements object.


public method Add3 → (4)

usage in : VertexElementUsage

Usage of vertex format element.

type in : VertexElementType

Data type of vertex format element.

count in : int32

[0..4]
Number of data values in vertex format element.

flags opt : VertexElementFlags = VertexElementFlags.None

Additional vertex element flags.

returns → VertexElements

The resulting vertex elements.

Appends the given vertex element using SizeCompact as VertexElement.Offset and returns the resulting VertexElements object.

Align


public method Align → (1)

alignment opt : int32 = 4

[>0]
The alignment of the vertex format size, in 32-bit words.

returns → VertexElements

The resulting vertex format element list.

Adjusts this vertex format element list so that SizeAligned becomes a multiple of alignment opt*4.

Get


public method Get → (1)

index in : int32

[0..VertexElements.Count-1]
Index of vertex format element.

returns → VertexElement

The vertex format element.

Returns the index in-th vertex format element.

The vertex format elements are sorted by their byte offset (see VertexElement.Offset) in ascending order.

Usage​Counter


[Pure]
public static method UsageCounter → (2)

usageCounter in : int32

The usage counter value to update.

usage in : VertexElementUsage

The usage semantic for which to increment the counter.

returns → int32

The resulting usage counter value.

Updates the given usage counter by incrementing the value for the given usage semantic.

Usage​Id


[Pure]
public static method UsageId → (2)

usage in : VertexElementUsage

The usage semantic.

index in : int32

The usage index, will be clamped to [0..63].

returns → int32

The usage ID in the range [-1..319]. Will be negative only if usage in is VertexElementUsage.Unknown.

Constructs a usage ID.

Writer


public method Writer → (1)

index in : int32

[0..VertexElements.Count-1]
Index of vertex format element.

returns → IVertexElementWriter

The IVertexElementWriter object.

Returns an independent IVertexElementWriter object for the index in-th vertex element.

Calling this method multiple times will return the same IVertexElementWriter object per index in.

Public / Attributes

Alignment


public attribute Alignment → (get)

value : int32

[>0]
The byte alignment.

Returns the byte alignment of this vertex element declaration.

The default value is 1, i.e. no alignment.

Count


public attribute Count → (get)

value : int32

[>=0]
The element count.

The number of vertex format elements.

Size​Aligned


public attribute SizeAligned → (get)

value : int32

[>=0]
The aligned vertex size, in bytes. Will always be a multiple of four.

Returns the aligned size of this vertex element declaration.

Size​Compact


public attribute SizeCompact → (get)

value : int32

[>=0]
The compact vertex size, in bytes. Will always be a multiple of four.

Returns the compact size of this vertex element declaration, without byte alignment.