Enumeration

MTLTextureType

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

Declaration

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

Overview

For a MTLTextureTypeCube texture, the property values describe one slice, which is any one of its six sides. For example, mipmapLevelCount is the number of mipmap levels for one slice, not the total sum of mipmap levels in six slices. By definition, the width and height of a cube texture are the same value.

Each slice of a cube texture maps to a side with a specific orientation, as detailed in Table 1.

Table 1

Cube slice orientation mappings

Slice index

Slice orientation

0

+X

1

-X

2

+Y

3

-Y

4

+Z

5

-Z

Topics

Specifying the Texture Type

MTLTextureType1D

A one-dimensional texture image.

MTLTextureType1DArray

An array of one-dimensional texture images.

MTLTextureType2D

A two-dimensional texture image.

MTLTextureType2DArray

An array of two-dimensional texture images.

MTLTextureType2DMultisample

A two-dimensional texture image that uses more than one sample for each pixel.

MTLTextureTypeCube

A cube texture with six two-dimensional images.

MTLTextureTypeCubeArray

An array of cube textures, each with six two-dimensional images.

MTLTextureType3D

A three-dimensional texture image.

MTLTextureType2DMultisampleArray

An array of two-dimensional texture images that use more than one sample for each pixel.

See Also

Querying Texture Attributes

textureType

The dimension and arrangement of the texture image data.

Required.

pixelFormat

The format of pixels in the texture.

Required.

width

The width of the texture image for the base level mipmap, in pixels.

Required.

height

The height of the texture image for the base level mipmap, in pixels.

Required.

depth

The depth of the texture image for the base level mipmap, in pixels.

Required.

mipmapLevelCount

The number of mipmap levels in the texture.

Required.

arrayLength

The number of slices in the texture array.

Required.

sampleCount

The number of samples in each pixel.

Required.

framebufferOnly

A Boolean value that indicates whether the texture can only be used as a render target.

Required.

usage

Options that determine how you can use the texture.

Required.

allowGPUOptimizedContents

A Boolean value indicating whether the GPU is allowed to adjust the contents of the texture to improve GPU performance.

Required.

shareable

A Boolean indicating whether this texture can be shared with other processes.

Required.

swizzle

The pattern that the GPU applies to pixels when you read or sample pixels from the texture.

Required.

MTLTextureUsage

An enumeration for the various options that determine how you can use a texture.