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

# buffer

The source buffer used to create this texture, if any.

```
var buffer: (any MTLBuffer)? { get }
```

## Discussion

When this value is `nil`, another [`MTLTexture`](/documentation/Metal/MTLTexture) instance provides texture data.

## See Also

[`makeTexture(descriptor:offset:bytesPerRow:)`](/documentation/Metal/MTLBuffer/makeTexture(descriptor:offset:bytesPerRow:))

Creates a texture that shares its storage with the buffer.



---

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)