Contents

withUnsafeMutableBytes(bufferIndex:_:)

Updates a Metal vertex buffer synchronously on the CPU.

Declaration

@MainActor func withUnsafeMutableBytes(bufferIndex: Int, _ callback: (UnsafeMutableRawBufferPointer) -> Void)

Discussion

The buffer is only valid for the lifetime of the callback.

See Also

Accessing mesh data on the CPU with Swift