Enumeration

MTLTextureType

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

Declaration

enum MTLTextureType : UInt

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

case type1D

A one-dimensional texture image.

case type1DArray

An array of one-dimensional texture images.

case type2D

A two-dimensional texture image.

case type2DArray

An array of two-dimensional texture images.

case type2DMultisample

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

case typeCube

A cube texture with six two-dimensional images.

case typeCubeArray

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

case type3D

A three-dimensional texture image.

case type2DMultisampleArray

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

case typeTextureBuffer

A texture buffer.

See Also

Specifying Texture Attributes

var textureType: MTLTextureType

The dimension and arrangement of texture image data.

var pixelFormat: MTLPixelFormat

The size and bit layout of all pixels in the texture.

var width: Int

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

var height: Int

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

var depth: Int

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

var mipmapLevelCount: Int

The number of mipmap levels for this texture.

var sampleCount: Int

The number of samples in each fragment.

var arrayLength: Int

The number of array elements for this texture.

var resourceOptions: MTLResourceOptions

The behavior of a new memory allocation.

var cpuCacheMode: MTLCPUCacheMode

The CPU cache mode used for the CPU mapping of the texture.

var storageMode: MTLStorageMode

The location and access permissions of the texture.

var hazardTrackingMode: MTLHazardTrackingMode

The texture's hazard tracking mode.

var allowGPUOptimizedContents: Bool

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

var usage: MTLTextureUsage

Options that determine how you can use the texture.

var swizzle: MTLTextureSwizzleChannels

The pattern you want the GPU to apply to pixels when you read or sample pixels from the texture.

struct MTLTextureSwizzleChannels

A pattern that modifies the data read or sampled from a texture by rearranging or duplicating the elements of a vector.

enum MTLTextureSwizzle

A set of options to choose from when creating a texture swizzle pattern.

struct MTLTextureUsage

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