Enumeration

MTLTextureUsage

The options that determine how a texture will be used.

Declaration

typedef enum MTLTextureUsage : NSUInteger {
    ...
} MTLTextureUsage;

Overview

You can combine multiple usage options if the texture serves multiple uses during its life cycle. The texture can be used only in the ways specified by its usage options; otherwise, an error occurs. Setting appropriate usage options allows Metal to optimize GPU operations for the texture.

Topics

Usage Options

MTLTextureUsageUnknown

An option that specifies that the texture usage is unknown.

MTLTextureUsageShaderRead

An option that enables reading or sampling from the texture.

MTLTextureUsageShaderWrite

An option that enables writing to the texture.

MTLTextureUsageRenderTarget

An option that enables using the texture as a color, depth, or stencil render target in a render pass descriptor.

MTLTextureUsagePixelFormatView

An option that enables using the texture to create texture views.

See Also

Properties

device

The device on which the image will be used.

width

The formal width of the image, in pixels.

height

The formal height of the image, in pixels.

featureChannels

The number of feature channels per pixel.

numberOfImages

The number of images for batch processing.

textureType

The type of the underlying texture, typically MTLTextureType2D or MTLTextureType2DArray.

MTLTextureType

The dimension of each image, including whether multiple images are arranged into an array or a cube.

pixelFormat

The pixel format of the underlying texture.

MTLPixelFormat

The data formats that describe the organization and characteristics of individual pixels in a texture.

precision

The number of bits of numeric precision available for each feature channel.

usage

The intended usage of the underlying texture.

pixelSize

The number of bytes from the first byte of one pixel to the first byte of the next pixel, in storage order. (Includes padding.)

texture

The underlying texture.

MTLTexture

A memory allocation for storing formatted image data that is accessible to the GPU.

label

A string to help identify this object.