<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLTextureSwizzleChannels",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@SA@MTLTextureSwizzleChannels"
  },
  "title" : "MTLTextureSwizzleChannels"
}
-->

# MTLTextureSwizzleChannels

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

```
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

[`init()`](/documentation/Metal/MTLTextureSwizzleChannels/init())

Creates a default swizzle pattern.

[`init(red:green:blue:alpha:)`](/documentation/Metal/MTLTextureSwizzleChannels/init(red:green:blue:alpha:))

Creates a swizzle pattern.

### Specifying swizzle values

[`red`](/documentation/Metal/MTLTextureSwizzleChannels/red)

The data copied to the first output channel.

[`green`](/documentation/Metal/MTLTextureSwizzleChannels/green)

The data copied to the second output channel.

[`blue`](/documentation/Metal/MTLTextureSwizzleChannels/blue)

The data copied to the third output channel.

[`alpha`](/documentation/Metal/MTLTextureSwizzleChannels/alpha)

The data copied to the fourth output channel.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)