Class GPUVertexLayout
Defines input layout of vertex buffer data passed to the Vertex Shader.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public sealed class GPUVertexLayout : GPUResource
Constructors
GPUVertexLayout()
Properties
Elements
Gets the list of elements used by this layout.
Declaration
[Unmanaged]
public VertexElement[] Elements { get; }
Property Value
VertexElement[]
|
ElementsString
Gets the list of elements used by this layout as a text (each element in a new line).
Declaration
[Unmanaged]
public string ElementsString { get; }
Property Value
System.String
|
Stride
Gets the size in bytes of all elements in the layout structure (including their offsets).
Declaration
[Unmanaged]
public uint Stride { get; }
Property Value
System.UInt32
|
Methods
FindElement(VertexElement.Types)
Searches for a given element type in a layout.
Declaration
[Unmanaged]
public VertexElement FindElement(VertexElement.Types type)
Parameters
VertexElement.Types
type
The type of element to find. |
Returns
VertexElement
Found element with properties or empty if missing. |
Get(GPUBuffer[])
Gets the vertex layout for a given list of vertex buffers (sequence of binding slots based on layouts set on those buffers). Uses internal cache to skip creating layout if it's already exists for a given list.
Declaration
[Unmanaged]
public static GPUVertexLayout Get(GPUBuffer[] vertexBuffers)
Parameters
GPUBuffer[]
vertexBuffers
The list of vertex buffers for the layout. |
Returns
GPUVertexLayout
Vertex layout object. Doesn't need to be cleared as it's cached for an application lifetime. |
Get(GPUVertexLayout[])
Merges list of layouts in a single one. Uses internal cache to skip creating layout if it's already exists for a given list.
Declaration
[Unmanaged]
public static GPUVertexLayout Get(GPUVertexLayout[] layouts)
Parameters
GPUVertexLayout[]
layouts
The list of layouts to merge. |
Returns
GPUVertexLayout
Vertex layout object. Doesn't need to be cleared as it's cached for an application lifetime. |
Get(VertexElement[], Boolean)
Gets the vertex layout for a given list of elements. Uses internal cache to skip creating layout if it's already exists for a given list.
Declaration
[Unmanaged]
public static GPUVertexLayout Get(VertexElement[] elements, bool explicitOffsets = false)
Parameters
VertexElement[]
elements
The list of elements for the layout. |
System.Boolean
explicitOffsets
If set to true, input elements offsets will be used without automatic calculations (offsets with value 0). |
Returns
GPUVertexLayout
Vertex layout object. Doesn't need to be cleared as it's cached for an application lifetime. |