Instance Method

minimumLinearTextureAlignment(for:)

Calculates the minimum alignment required for creating a linear texture with a given pixel format.

Required.

Declaration

func minimumLinearTextureAlignment(for format: MTLPixelFormat) -> Int

Parameters

format

The intended pixel format of the linear texture. This value must not be a depth, stencil, or compressed pixel format.

Return Value

The minimum alignment required for creating a linear texture with a given pixel format.

Discussion

Linear textures must be byte aligned to their minimum alignment value, which directly affects the expected value for the offset and bytesPerRow parameters of the makeTexture(descriptor:offset:bytesPerRow:) method.

Topics

Pixel Formats

enum MTLPixelFormat

The data formats that describe the organization and characteristics of individual pixels in a texture.

See Also

Querying Texture Support

func supportsTextureSampleCount(Int) -> Bool

Determines whether a device supports a given texture sample count.

Required.

func minimumTextureBufferAlignment(for: MTLPixelFormat) -> Int

Calculates the minimum alignment required when creating a texture buffer from a buffer.

Required.

var readWriteTextureSupport: MTLReadWriteTextureTier

The device objects's read-write texture support tier.

Required.