MTLTextureDescriptor
An instance that you use to configure new Metal texture instances.
Declaration
class MTLTextureDescriptorMentioned in
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:)textureCubeDescriptor(pixelFormat:size:mipmapped:)textureBufferDescriptor(with:width:resourceOptions:usage:)
Specifying texture attributes
textureTypepixelFormatwidthheightdepthmipmapLevelCountsampleCountarrayLengthresourceOptionscpuCacheModestorageModehazardTrackingModeallowGPUOptimizedContentsusageswizzleMTLTextureSwizzleChannelsMTLTextureSwizzleMTLTextureTypeMTLTextureUsage