<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTL4MeshRenderPipelineDescriptor/payloadMemoryLength",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTL4MeshRenderPipelineDescriptor(py)payloadMemoryLength"
  },
  "title" : "payloadMemoryLength"
}
-->

# payloadMemoryLength

Reserves storage for the object-to-mesh stage payload.

```
var payloadMemoryLength: Int { get set }
```

## Discussion

This property determines the size, in bytes, of the buffer you indicate via the Metal Shading Language `[[payload]]`
attribute in the object and mesh shader functions of the mesh render pipeline.

If this value is `0`, Metal derives the size from the (dereferenced) type you declare for the payload in the object
shader function. If the type is a pointer, Metal reserves space for a single element.

The default value is `0`.

---

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)