Instance Method

minimumLinearTextureAlignmentForPixelFormat:

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

Required.

Declaration

- (NSUInteger)minimumLinearTextureAlignmentForPixelFormat:(MTLPixelFormat)format;

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 newTextureWithDescriptor:offset:bytesPerRow: method.

Topics

Pixel Formats

MTLPixelFormat

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

See Also

Querying Texture Support

- supportsTextureSampleCount:

Determines whether a device supports a given texture sample count.

Required.

- minimumTextureBufferAlignmentForPixelFormat:

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

Required.

readWriteTextureSupport

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

Required.