Structure

MTLTextureSwizzleChannels

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

Declaration

struct MTLTextureSwizzleChannels

Overview

Use this structure to specify a custom swizzle pattern when creating a new texture or texture view.

Topics

Creating a Swizzle Pattern

Specifying Swizzle Values

var red: MTLTextureSwizzle

The data copied to the first output channel.

var green: MTLTextureSwizzle

The data copied to the second output channel.

var blue: MTLTextureSwizzle

The data copied to the third output channel.

var alpha: MTLTextureSwizzle

The data copied to the fourth output channel.

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.

enum MTLTextureSwizzle

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