Contents

makeTexture(descriptor:offset:)

Creates a texture at a specified offset on the heap.

Declaration

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

Parameters

  • descriptor:

    A descriptor object that describes the properties of the texture.

  • offset:

    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.

Discussion

You can call the method with the following restrictions:

Use the heapBufferSizeAndAlign(length:options:) to determine the correct size and alignment.

See Also

Creating textures from a heap