Struct InputElementDescription
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
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
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
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
Remarks
InstanceDataStepRate
The number of instances to draw using the same per-instance data before advancing to the next element.
public int InstanceDataStepRate
Field Value
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
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
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
otherInputElementDescriptionAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
leftInputElementDescriptionrightInputElementDescription
Returns
operator !=(InputElementDescription, InputElementDescription)
public static bool operator !=(InputElementDescription left, InputElementDescription right)
Parameters
leftInputElementDescriptionrightInputElementDescription