Contents

texture2DDescriptor(pixelFormat:width:height:mipmapped:)

Creates a texture descriptor object for a 2D texture.

Declaration

class func texture2DDescriptor(pixelFormat: MTLPixelFormat, width: Int, height: Int, mipmapped: Bool) -> MTLTextureDescriptor

Parameters

  • pixelFormat:

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

  • width:

    The width of the 2D texture image. The value needs to be greater than or equal to 1.

  • height:

    The height of the 2D texture image. The value needs to be greater than or equal to 1.

  • mipmapped:

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

Return Value

A pointer to a texture descriptor object for a 2D texture.

See Also

Related Documentation

  • Metal Shading Language Guide
  • Metal Programming Guide

Creating texture descriptors