An object that describes a set of attributes that share a buffer index, offset,
and stride.
Applications typically express their types using contiguous or interleaved (strided) memory.
If you interleave your data (meaning that you represent it with a structure),
use one `Layout` object where ``bufferStride`` is equal to
`MemoryLayout<Type>.stride()`.
If you store your attributes separately, use one `Layout` per attribute.
init(bufferIndex: Int, bufferOffset: Int = 0, bufferStride: Int)
get · iOS 18.0+
bufferIndex
TypeScript
get bufferIndex(): Promise<number>
Swift declaration
var bufferIndex: Int
The index of the buffer to use for this layout.
Most usage scenarios only use one buffer.
Use a buffer index that is less than
``LowLevelMesh/Descriptor-swift.struct/vertexBufferCount``.
set · iOS 18.0+
bufferIndex
TypeScript
setBufferIndex(value: number): Promise<void>
Swift declaration
var bufferIndex: Int
The index of the buffer to use for this layout.
Most usage scenarios only use one buffer.
Use a buffer index that is less than
``LowLevelMesh/Descriptor-swift.struct/vertexBufferCount``.
get · iOS 18.0+
bufferOffset
TypeScript
get bufferOffset(): Promise<number>
Swift declaration
var bufferOffset: Int
The byte offset into the buffer for the first byte of this layout.
set · iOS 18.0+
bufferOffset
TypeScript
setBufferOffset(value: number): Promise<void>
Swift declaration
var bufferOffset: Int
The byte offset into the buffer for the first byte of this layout.
get · iOS 18.0+
bufferStride
TypeScript
get bufferStride(): Promise<number>
Swift declaration
var bufferStride: Int
The distance, in bytes, between consecutive vertices for attributes using this layout.
set · iOS 18.0+
bufferStride
TypeScript
setBufferStride(value: number): Promise<void>
Swift declaration
var bufferStride: Int
The distance, in bytes, between consecutive vertices for attributes using this layout.
get · iOS 27.0+
stepFunction
TypeScript
get stepFunction(): Promise<_Metal_MTLVertexStepFunction>
Swift declaration
var stepFunction: MTLVertexStepFunction
Determines how the vertex shader steps through the data in this layout.
Set to `.perInstance` to supply per-instance data (for example, per-instance
color) from a vertex buffer. Defaults to `.perVertex`.
Determines how the vertex shader steps through the data in this layout.
Set to `.perInstance` to supply per-instance data (for example, per-instance
color) from a vertex buffer. Defaults to `.perVertex`.
get · iOS 27.0+
stepRate
TypeScript
get stepRate(): Promise<number>
Swift declaration
var stepRate: Int
The number of instances that share the same per-instance vertex data.
Used together with `stepFunction`. When `stepFunction` is `.perInstance`,
the vertex shader advances to the next entry in this layout once per
`stepRate` instances. Defaults to `1`.
set · iOS 27.0+
stepRate
TypeScript
setStepRate(value: number): Promise<void>
Swift declaration
var stepRate: Int
The number of instances that share the same per-instance vertex data.
Used together with `stepFunction`. When `stepFunction` is `.perInstance`,
the vertex shader advances to the next entry in this layout once per
`stepRate` instances. Defaults to `1`.