An object responsible for allocating mesh vertex data loaded from the asset.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- Model I/O
You specify an allocator when loading an asset with the
init(url: initializer. If you do not specify an allocator, or import an asset through other means, the
MDLAsset class uses an internal allocator object.
For example, to use the MetalKit framework for loading vertex data into GPU buffers for rendering with Metal, pass a
MTKMesh object for the
buffer parameter. By specifying an allocator, you ensure that mesh data is copied a minimal number of times between being read from a file and being loaded into GPU memory for rendering.