---
title: texture
framework: metalperformanceshaders
role: symbol
role_heading: Instance Property
path: metalperformanceshaders/mpsimage/texture
---

# texture

The underlying texture.

## Declaration

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

## Discussion

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 object typically cause their arguments to become allocated. Likewise, MPSImage objects initialized with the init(texture:featureChannels:) method have already been allocated.

## See Also

### Properties

- [device](metalperformanceshaders/mpsimage/device.md)
- [width](metalperformanceshaders/mpsimage/width.md)
- [height](metalperformanceshaders/mpsimage/height.md)
- [featureChannels](metalperformanceshaders/mpsimage/featurechannels.md)
- [numberOfImages](metalperformanceshaders/mpsimage/numberofimages.md)
- [textureType](metalperformanceshaders/mpsimage/texturetype.md)
- [MTLTextureType](metal/mtltexturetype.md)
- [pixelFormat](metalperformanceshaders/mpsimage/pixelformat.md)
- [MTLPixelFormat](metal/mtlpixelformat.md)
- [precision](metalperformanceshaders/mpsimage/precision.md)
- [usage](metalperformanceshaders/mpsimage/usage.md)
- [MTLTextureUsage](metal/mtltextureusage.md)
- [pixelSize](metalperformanceshaders/mpsimage/pixelsize.md)
- [MTLTexture](metal/mtltexture.md)
- [label](metalperformanceshaders/mpsimage/label.md)
