<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLMeshBuffer",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(pl)MDLMeshBuffer"
  },
  "title" : "MDLMeshBuffer"
}
-->

# MDLMeshBuffer

The general interface for managing storage of vertex and index data used in loading, processing, and rendering meshes.

```
protocol MDLMeshBuffer : NSCopying, NSObjectProtocol
```

## Overview

Model I/O creates buffers using an allocator that you specify when loading mesh data from a file with the [`MDLAsset`](/documentation/ModelIO/MDLAsset) class or generating meshes with the [`MDLMesh`](/documentation/ModelIO/MDLMesh) class. You can also create buffers using an allocator method such as [`newBuffer(with:type:)`](/documentation/ModelIO/MDLMeshBufferAllocator/newBuffer(with:type:)). The allocator you choose determines the concrete class of a mesh buffer and thus its storage mechanism—for example, the MetalKit <doc://com.apple.documentation/documentation/MetalKit/MTKMeshBufferAllocator> class allocates <doc://com.apple.documentation/documentation/MetalKit/MTKMeshBuffer> objects, which share storage with Metal buffers for use in rendering.

## Topics

### Working with Data in a Buffer

[`fill(_:offset:)`](/documentation/ModelIO/MDLMeshBuffer/fill(_:offset:))

Writes the specified data into the buffer.

[`map()`](/documentation/ModelIO/MDLMeshBuffer/map())

Provides direct, read-only access to the buffer’s contents.

[`length`](/documentation/ModelIO/MDLMeshBuffer/length)

The data size of the buffer, in bytes.

### Inspecting a Buffer

[`allocator`](/documentation/ModelIO/MDLMeshBuffer/allocator)

The allocator object that created the buffer.

[`zone`](/documentation/ModelIO/MDLMeshBuffer/zone)

The memory pool from which the buffer was created.

[`type`](/documentation/ModelIO/MDLMeshBuffer/type)

The type of data contained in a buffer.

### Constants

[`MDLMeshBufferType`](/documentation/ModelIO/MDLMeshBufferType)

Options for the content of a mesh buffer, used by the [`type`](/documentation/ModelIO/MDLMeshBuffer/type) property and by [`MDLMeshBufferAllocator`](/documentation/ModelIO/MDLMeshBufferAllocator) methods for creating buffers.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)