Class LayoutDescription
A generic description of vertex inputs to the device's input assembler stage. This object describes the inputs from a single vertex buffer.
Implements
Inherited Members
Namespace: Evergine.Common.Graphics
Assembly: Evergine.Common.dll
Syntax
public class LayoutDescription : IEquatable<LayoutDescription>
Remarks
Shaders may use inputs from multiple vertex buffers.
Constructors
LayoutDescription(VertexStepFunction, uint)
Initializes a new instance of the LayoutDescription class.
Declaration
public LayoutDescription(VertexStepFunction stepFunction = VertexStepFunction.PerVertexData, uint stepRate = 0)
Parameters
Type | Name | Description |
---|---|---|
VertexStepFunction | stepFunction | The frequency with which the vertex function fetches attributes data. |
uint | stepRate | The number of instances to draw using the same per-instance data before advancing in the buffer by one element. This value must be 0 for an element that contains per-vertex data. |
Fields
Elements
The collection of individual vertex elements comprising a single vertex.
Declaration
public List<ElementDescription> Elements
Field Value
Type | Description |
---|---|
List<ElementDescription> |
StepFunction
The frequency with which the vertex function fetches attributes data.
Declaration
public VertexStepFunction StepFunction
Field Value
Type | Description |
---|---|
VertexStepFunction |
StepRate
A value controlling how often data for instances is advanced for this layout. For per-vertex elements, this value should be 0.
Declaration
public int StepRate
Field Value
Type | Description |
---|---|
int |
Stride
The total size of an individual vertex in bytes.
Declaration
public uint Stride
Field Value
Type | Description |
---|---|
uint |
Methods
Add(ElementDescription)
Adds a new ElementDescription to layout.
Declaration
public LayoutDescription Add(ElementDescription element)
Parameters
Type | Name | Description |
---|---|---|
ElementDescription | element | Element description. |
Returns
Type | Description |
---|---|
LayoutDescription | My own instance. |
Equals(LayoutDescription)
Returns a hash code for this instance.
Declaration
public bool Equals(LayoutDescription other)
Parameters
Type | Name | Description |
---|---|---|
LayoutDescription | other | Other used to compare. |
Returns
Type | Description |
---|---|
bool | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
GetFormatSizeInBytes(ElementFormat)
Get the size in byte of a specific vertex element format.
Declaration
public static uint GetFormatSizeInBytes(ElementFormat format)
Parameters
Type | Name | Description |
---|---|---|
ElementFormat | format | The vertex element formant. |
Returns
Type | Description |
---|---|
uint | The size in bytes. |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
Read(BinaryReader)
Read LayoutDescription from Binary file.
Declaration
public static LayoutDescription Read(BinaryReader reader)
Parameters
Type | Name | Description |
---|---|---|
BinaryReader | reader | The binary reader. |
Returns
Type | Description |
---|---|
LayoutDescription | The readed layoutDescription. |
Write(BinaryWriter)
Write LayoutDescription into binary file.
Declaration
public void Write(BinaryWriter writer)
Parameters
Type | Name | Description |
---|---|---|
BinaryWriter | writer | The binary writer. |
Operators
operator ==(LayoutDescription, LayoutDescription)
Implements the operator ==.
Declaration
public static bool operator ==(LayoutDescription value1, LayoutDescription value2)
Parameters
Type | Name | Description |
---|---|---|
LayoutDescription | value1 | The value1. |
LayoutDescription | value2 | The value2. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
operator !=(LayoutDescription, LayoutDescription)
Implements the operator ==.
Declaration
public static bool operator !=(LayoutDescription value1, LayoutDescription value2)
Parameters
Type | Name | Description |
---|---|---|
LayoutDescription | value1 | The value1. |
LayoutDescription | value2 | The value2. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |