Instance Method


Creates a texture at a specified offset on the heap.



func makeTexture(descriptor: MTLTextureDescriptor, offset: Int) -> MTLTexture?



A descriptor object that describes the properties of the texture.


The distance, in bytes, to place the texture relative to the start of the heap.

Return Value

A new texture, or nil if the heap is not a placement heap.


The heap's type must be MTLHeapType.placement.

The texture’s CPU cache mode must match the heap’s cpuCacheMode value. The texture’s storage mode must either match the heap’s storageMode value or be a MTLStorageMode.memoryless value.

Use the heapBufferSizeAndAlign(length:options:) to determine the required size and alignment. If you don't align the texture correctly or it extends past the end of the heap, the behavior is undefined.

Any resources in the heap within an overlapping half-open range [offset, offset + requiredSize) are implicitly aliased with the new resource.

See Also

Creating Resources on the Heap