Contents

replaceUnsafeMutableBytes(bufferIndex:_:)

Replaces a Metal vertex buffer synchronously on the CPU.

Declaration

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

Discussion

The buffer’s contents are unspecified, and it is the caller’s responsibility to populate the buffer with valid data. The buffer is only valid for the lifetime of the callback.

See Also

Accessing mesh data on the CPU with Swift