Enumeration Case

MTLTextureUsageShaderRead

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

Declaration

MTLTextureUsageShaderRead = 0x0001

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 MTLTextureUsageShaderWrite option to enable the access::read_write attribute.

See Also

Specifying Texture Usage Options

MTLTextureUsageUnknown

An option for a texture whose usage is unknown.

MTLTextureUsageShaderWrite

An option for writing to the texture in a shader.

MTLTextureUsageRenderTarget

An option for rendering to the texture in a render pass.

MTLTextureUsagePixelFormatView

An option to create texture views with a different component layout.