Enumeration Case

MTLTextureUsageShaderWrite

An option for writing to the texture in a shader.

Declaration

MTLTextureUsageShaderWrite = 0x0002

Discussion

Set this option if you access the given texture with a write() function in any shader. This option enables the access::write attribute 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 read() function in the same shader, set the MTLTextureUsageShaderRead option to enable the access::read_write attribute.

In iOS devices with GPU family 5, Metal doesn’t apply lossless compression to the given texture if you set this option.

See Also

Specifying Texture Usage Options

MTLTextureUsageUnknown

An option for a texture whose usage is unknown.

MTLTextureUsageShaderRead

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

MTLTextureUsageRenderTarget

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

MTLTextureUsagePixelFormatView

An option for creating texture views.