---
title: pixelFormat
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlrenderpipelinecolorattachmentdescriptor/pixelformat
---

# pixelFormat

The pixel format of the color attachment’s texture.

## Declaration

```swift
var pixelFormat: MTLPixelFormat { get set }
```

## Mentioned in

Using the Metal 4 compilation API

## Discussion

Discussion The pixel format of the rendering pipeline state needs to be set to match the pixel format of the texture used by the selected color attachment; otherwise, an error occurs.

## 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)

### Configuring render pipeline states

- [writeMask](metal/mtlrenderpipelinecolorattachmentdescriptor/writemask.md)
- [MTLColorWriteMask](metal/mtlcolorwritemask.md)
