Contents

usage

Options that determine how you can use the texture.

Declaration

var usage: MTLTextureUsage { get set }

Mentioned in

Discussion

The default value for this property is shaderRead. If the given texture has multiple uses in your app, you can combine multiple usage options for that texture. After you set a texture’s usage options, you can use it only in the ways that you specified.

Metal can optimize operations for a given texture, based on its intended use. Set explicit usage options for a texture, if you know them in advance, before you use the texture. Only set usage options that correspond to a texture’s intended use.

In iOS devices with GPU family 5, Metal doesn’t apply lossless compression to a given texture if you set any of these options:

See Also

Specifying texture attributes