heapBufferSizeAndAlign(length:options:)
Returns the size and alignment, in bytes, of a buffer if you create it from a heap.
Declaration
func heapBufferSizeAndAlign(length: Int, options: MTLResourceOptions = []) -> MTLSizeAndAlignParameters
- length:
The size of the buffer, in bytes.
- options:
An Mtlresourceoptions instance for a would-be buffer’s storage and hazard tracking modes. See Resource Fundamentals and Setting Resource Storage Modes for more information.
Return Value
An MTLSizeAndAlign instance.
Discussion
Use this method to help estimate an appropriate size for a new heap before you create it.