<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSImage/texture",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSImage(py)texture"
  },
  "title" : "texture"
}
-->

# texture

The underlying texture.

```
var texture: any MTLTexture { get }
```

## Discussion

This is a 2D texture if `numberOfImages=1` and `featureChannels<=4`. It is a 2D texture array otherwise.

To avoid the high cost of premature allocation of the underlying texture, avoid accessing this property except when strictly necessary. Calls to the `encode` methods of an [`MPSCNNKernel`](/documentation/MetalPerformanceShaders/MPSCNNKernel) object typically cause their arguments to become allocated. Likewise, [`MPSImage`](/documentation/MetalPerformanceShaders/MPSImage) objects initialized with the [`init(texture:featureChannels:)`](/documentation/MetalPerformanceShaders/MPSImage/init(texture:featureChannels:)) method have already been allocated.

---

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)