Contents

sparseTileSize(with:pixelFormat:sampleCount:)

Returns the dimensions of a sparse tile for a texture.

Declaration

func sparseTileSize(with textureType: MTLTextureType, pixelFormat: MTLPixelFormat, sampleCount: Int) -> MTLSize

Parameters

Mentioned in

Return Value

A new MTLSize instance.

Discussion

The size of a sparse tile, in bytes, is the same for all sparse textures on a GPU device object. Because the size of pixels may vary, the actual dimensions of a sparse tile vary based on the texture and the pixel format. Use this method to get the dimensions of the tile for a particular format. Use these dimensions when converting regions from pixel-based units to sparse tile units and vice versa.

See Also

Working with sparse textures