Instance Method

heapBufferSizeAndAlign(length:options:)

Returns the size and alignment, in bytes, of a buffer sub-allocated from a heap.

Required.

Declaration

func heapBufferSizeAndAlign(length: Int, options: MTLResourceOptions = []) -> MTLSizeAndAlign

Parameters

length

The size, in bytes, of the buffer.

options

Options that describe the properties of the buffer.

Return Value

A structure representing the size and alignment, in bytes, of a buffer that will be sub-allocated from a heap.

Discussion

You can use this method to help you determine the correct size for the heap, specified with the size property of a MTLHeapDescriptor object.

Topics

Size and Align Structure

struct MTLSizeAndAlign

The size and alignment of a resource, in bytes.

See Also

Creating Resource Heaps

func heapTextureSizeAndAlign(descriptor: MTLTextureDescriptor) -> MTLSizeAndAlign

Returns the size and alignment, in bytes, of a texture sub-allocated from a heap.

Required.