---
title: texture
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlrenderpassattachmentdescriptor/texture
---

# texture

The texture object associated with this attachment.

## Declaration

```swift
var texture: (any MTLTexture)? { get set }
```

## Mentioned in

Setting load and store actions Choosing a resource storage mode for Apple GPUs

## Discussion

Discussion You need to set the attachment’s texture property, choosing an appropriate pixel format for the texture. To store color values in an attachment, use a texture with a color-renderable pixel format. To store depth values, use a texture with a depth-renderable pixel format, such as MTLPixelFormat.depth32Float. To store stencil values, use a texture with a stencil-renderable pixel format, such as MTLPixelFormat.stencil8.

## See Also

### Related Documentation

- [Metal Shading Language Guide](apple-archive/documentation/Metal/Reference/MetalShadingLanguageGuide/Introduction.md)
- [Metal Programming Guide](apple-archive/documentation/Miscellaneous/Conceptual/MetalProgrammingGuide/Introduction.md)

### Specifying the texture for the attachment

- [level](metal/mtlrenderpassattachmentdescriptor/level.md)
- [slice](metal/mtlrenderpassattachmentdescriptor/slice.md)
- [depthPlane](metal/mtlrenderpassattachmentdescriptor/depthplane.md)
