Table of Contents

Struct InputElementDescription

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

Describes a single input element for the definition of a vertex format layout.

public struct InputElementDescription : IEquatable<InputElementDescription>
Implements
Inherited Members
Extension Methods

Remarks

Each input element defines how a portion of a vertex or instance is read from a Vertex Buffer and mapped to a shader input.
This structure is typically used to define the layout of vertex data when creating an input layout object.

Fields

AlignedByteOffset

The byte offset from the start of the vertex to this element.

public int AlignedByteOffset

Field Value

int

Remarks

Use -1 (or a constant like AppendAligned to automatically align the element after the previous one.

Format

The data format of the element, such as R32G32B32_Float or R8G8B8A8_UNorm.

public PixelFormat Format

Field Value

PixelFormat

Remarks

This must match the format expected by the Shader and the layout of the Vertex Buffer.

InputSlot

The input slot index from which this element is read.

public int InputSlot

Field Value

int

Remarks

Multiple Vertex Buffers can be bound to different input slots. This value selects which one to use for this element.

InputSlotClass

Specifies whether the data is per-vertex or per-instance.

public InputClassification InputSlotClass

Field Value

InputClassification

Remarks

Use Vertex for standard vertex attributes, or Instance for instancing.

InstanceDataStepRate

The number of instances to draw using the same per-instance data before advancing to the next element.

public int InstanceDataStepRate

Field Value

int

Remarks

This must be 0 for per-vertex data. For instanced data, a value of 1 means the data advances every instance.

SemanticIndex

The semantic index for the element, used when multiple elements share the same semantic name.

public int SemanticIndex

Field Value

int

Remarks

For example, a 4x4 matrix might be passed as four "TEXCOORD" elements with indices 0 through 3.

SemanticName

The semantic name associated with this element, such as "POSITION", "TEXCOORD", or "NORMAL".

public string SemanticName

Field Value

string

Remarks

This name must match the semantic used in the Vertex Shader input signature.

Methods

Equals(InputElementDescription)

Indicates whether the current object is equal to another object of the same type.

public readonly bool Equals(InputElementDescription other)

Parameters

other InputElementDescription

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override readonly bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override readonly int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(InputElementDescription, InputElementDescription)

public static bool operator ==(InputElementDescription left, InputElementDescription right)

Parameters

left InputElementDescription
right InputElementDescription

Returns

bool

operator !=(InputElementDescription, InputElementDescription)

public static bool operator !=(InputElementDescription left, InputElementDescription right)

Parameters

left InputElementDescription
right InputElementDescription

Returns

bool