sparseTileSize(with:pixelFormat:sampleCount:)
Returns the dimensions of a sparse tile for a texture.
Declaration
func sparseTileSize(with textureType: MTLTextureType, pixelFormat: MTLPixelFormat, sampleCount: Int) -> MTLSizeParameters
- textureType:
An Mtltexturetype instance.
- pixelFormat:
An Mtlpixelformat instance.
- sampleCount:
The number of samples for each pixel.
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
sparseTileSize(textureType:pixelFormat:sampleCount:sparsePageSize:)sparseTileSizeInBytes(sparsePageSize:)sparseTileSizeInBytesconvertSparsePixelRegions(_:toTileRegions:withTileSize:alignmentMode:numRegions:)convertSparseTileRegions(_:toPixelRegions:withTileSize:numRegions:)MTLSparsePageSizeMTLSparseTextureRegionAlignmentMode