A resource that stores data in a format defined by your app.
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
MTLBufferobject with a new storage allocation.
Buffer(bytes: length: options:)
MTLBufferobject by copying data from an existing storage allocation into a new allocation.
Buffer(bytes No Copy: length: options: deallocator:)
MTLBufferobject that reuses an existing storage allocation and does not allocate any new storage.
The Metal framework doesn’t know anything about the contents of a
MTLBuffer, just its size. You define the format of the data in the buffer and ensure that your app and your shaders know how to read and write the data. For example, you might create a struct in your shader that defines the data you want to store in the buffer and its memory layout.