<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLResource/heapOffset",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLResource(py)heapOffset"
  },
  "title" : "heapOffset"
}
-->

# heapOffset

The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.

```
var heapOffset: Int { get }
```

## Discussion

If the heap is not a placement heap ([`MTLHeapType.placement`](/documentation/Metal/MTLHeapType/placement)), the value is always `0` and should be ignored.

---

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)