---
title: MTLTextureDescriptor
framework: metal
role: symbol
role_heading: Class
path: metal/mtltexturedescriptor
---

# MTLTextureDescriptor

An instance that you use to configure new Metal texture instances.

## Declaration

```swift
class MTLTextureDescriptor
```

## Mentioned in

Choosing a resource storage mode for Apple GPUs Setting resource storage modes Synchronizing a managed resource in macOS Understanding the Metal 4 core API

## Overview

Overview To create a new texture, first create an MTLTextureDescriptor instance and set its property values. Then, call either the makeTexture(descriptor:) or makeTexture(descriptor:iosurface:plane:) method of an MTLDevice instance, or the makeTexture(descriptor:offset:bytesPerRow:) method of an MTLBuffer instance. When you create a texture, Metal copies property values from the descriptor into the new texture. You can reuse an MTLTextureDescriptor instance, modifying its property values as needed, to create more MTLTexture instances, without affecting any textures you already created.

## Topics

### Creating texture descriptors

- [texture2DDescriptor(pixelFormat:width:height:mipmapped:)](metal/mtltexturedescriptor/texture2ddescriptor(pixelformat:width:height:mipmapped:).md)
- [textureCubeDescriptor(pixelFormat:size:mipmapped:)](metal/mtltexturedescriptor/texturecubedescriptor(pixelformat:size:mipmapped:).md)
- [textureBufferDescriptor(with:width:resourceOptions:usage:)](metal/mtltexturedescriptor/texturebufferdescriptor(with:width:resourceoptions:usage:).md)

### Specifying texture attributes

- [textureType](metal/mtltexturedescriptor/texturetype.md)
- [pixelFormat](metal/mtltexturedescriptor/pixelformat.md)
- [width](metal/mtltexturedescriptor/width.md)
- [height](metal/mtltexturedescriptor/height.md)
- [depth](metal/mtltexturedescriptor/depth.md)
- [mipmapLevelCount](metal/mtltexturedescriptor/mipmaplevelcount.md)
- [sampleCount](metal/mtltexturedescriptor/samplecount.md)
- [arrayLength](metal/mtltexturedescriptor/arraylength.md)
- [resourceOptions](metal/mtltexturedescriptor/resourceoptions.md)
- [cpuCacheMode](metal/mtltexturedescriptor/cpucachemode.md)
- [storageMode](metal/mtltexturedescriptor/storagemode.md)
- [hazardTrackingMode](metal/mtltexturedescriptor/hazardtrackingmode.md)
- [allowGPUOptimizedContents](metal/mtltexturedescriptor/allowgpuoptimizedcontents.md)
- [usage](metal/mtltexturedescriptor/usage.md)
- [swizzle](metal/mtltexturedescriptor/swizzle.md)
- [MTLTextureSwizzleChannels](metal/mtltextureswizzlechannels.md)
- [MTLTextureSwizzle](metal/mtltextureswizzle.md)
- [MTLTextureType](metal/mtltexturetype.md)
- [MTLTextureUsage](metal/mtltextureusage.md)

### Instance Properties

- [compressionType](metal/mtltexturedescriptor/compressiontype.md)
- [placementSparsePageSize](metal/mtltexturedescriptor/placementsparsepagesize.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Texture basics

- [Understanding color-renderable pixel format sizes](metal/understanding-color-renderable-pixel-format-sizes.md)
- [Optimizing texture data](metal/optimizing-texture-data.md)
- [MTLTexture](metal/mtltexture.md)
- [MTLTextureCompressionType](metal/mtltexturecompressiontype.md)
- [MTKTextureLoader](metalkit/mtktextureloader.md)
- [MTLSharedTextureHandle](metal/mtlsharedtexturehandle.md)
- [MTLPixelFormat](metal/mtlpixelformat.md)
