---
title: shaderRead
framework: metal
role: symbol
role_heading: Type Property
path: metal/mtltextureusage/shaderread
---

# shaderRead

An option for reading or sampling from the texture in a shader.

## Declaration

```swift
static var shaderRead: MTLTextureUsage { get }
```

## Discussion

Discussion Set this option if you access the given texture with a read() or sample() function in any shader. This option enables the access::read and access::sample attributes for the texture. For more information about texture functions and access attributes, see Metal Shading Language Guide. If the texture is a read-write texture that you also access with a write() function in the same shader, set the shaderWrite option to enable the access::read_write attribute.

## See Also

### Specifying texture usage options

- [unknown](metal/mtltextureusage/unknown.md)
- [shaderWrite](metal/mtltextureusage/shaderwrite.md)
- [shaderAtomic](metal/mtltextureusage/shaderatomic.md)
- [renderTarget](metal/mtltextureusage/rendertarget.md)
- [pixelFormatView](metal/mtltextureusage/pixelformatview.md)
