Instance Method

heapBufferSizeAndAlignWithLength:options:

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

Required.

Declaration

- (MTLSizeAndAlign)heapBufferSizeAndAlignWithLength:(NSUInteger)length options:(MTLResourceOptions)options;

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

MTLSizeAndAlign

The size and alignment of a resource, in bytes.

See Also

Creating Resource Heaps

- newHeapWithDescriptor:

Creates a heap.

Required.

- heapTextureSizeAndAlignWithDescriptor:

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

Required.