Type Method

textureCubeDescriptorWithPixelFormat:size:mipmapped:

Creates a texture descriptor object for a cube texture.

Declaration

+ (MTLTextureDescriptor *)textureCubeDescriptorWithPixelFormat:(MTLPixelFormat)pixelFormat size:(NSUInteger)size mipmapped:(BOOL)mipmapped;

Parameters

pixelFormat

The format describing how every pixel on the texture image is stored. The default value is MTLPixelFormatRGBA8Unorm.

size

The width and height of each slice of the cube texture. The value must be greater than or equal to 1.

mipmapped

A Boolean indicating whether the resulting image should be mipmapped. If YES, then the mipmapLevelCount property in the returned descriptor is computed from width and height. If NO, then mipmapLevelCount is 1.

Return Value

A pointer to a texture descriptor object for a cube texture.

Discussion

For a cube texture, the property values describe one slice, which is any one of its six sides. Each slice is a square.

See Also

Creating Texture Descriptors

+ texture2DDescriptorWithPixelFormat:width:height:mipmapped:

Creates a texture descriptor object for a 2D texture.

+ textureBufferDescriptorWithPixelFormat:width:resourceOptions:usage:

Creates a texture descriptor object for a texture buffer.