---
title: readMask
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlstencildescriptor/readmask
---

# readMask

A bitmask that determines from which bits that stencil comparison tests can read.

## Declaration

```swift
var readMask: UInt32 { get set }
```

## Discussion

Discussion The readMask bits are used for logical AND operations to both the stored stencil value and the reference value. The least significant bits of the read mask are used. The default value is all ones. A logical AND operation with the default readMask does not change the value.

## See Also

### Related Documentation

- [setStencilReferenceValue(_:)](metal/mtlrendercommandencoder/setstencilreferencevalue(_:).md)

### Configuring stencil bit mask properties

- [writeMask](metal/mtlstencildescriptor/writemask.md)
