---
title: writeMask
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlrenderpipelinecolorattachmentdescriptor/writemask
---

# writeMask

A bitmask that restricts which color channels are written into the texture.

## Declaration

```swift
var writeMask: MTLColorWriteMask { get set }
```

## Discussion

Discussion The default value of writeMask is all ones, all, which allows all color channels to be blended. The MTLColorWriteMask values MTLColorWriteMaskRed, MTLColorWriteMaskGreen, MTLColorWriteMaskBlue, and MTLColorWriteMaskAlpha limit blending to one color channel, and these values can be bitwise combined. MTLColorWriteMaskNone does not allow any color channels to be blended.

## See Also

### Configuring render pipeline states

- [pixelFormat](metal/mtlrenderpipelinecolorattachmentdescriptor/pixelformat.md)
- [MTLColorWriteMask](metal/mtlcolorwritemask.md)
