Instance Method

makeTexture(descriptor:)

Creates a texture on the heap.

Required.

Declaration

func makeTexture(descriptor desc: MTLTextureDescriptor) -> MTLTexture?

Parameters

desc

A descriptor object that describes the properties of the texture.

Return Value

A new texture object backed by heap memory, or nil if the heap memory is full.

Discussion

The heap's type must be MTLHeapType.automatic.

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.

See Also

Creating Resources on the Heap

func makeBuffer(length: Int, options: MTLResourceOptions, offset: Int) -> MTLBuffer?

Creates a buffer at a specified offset on the heap.

Required.

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

Creates a texture at a specified offset on the heap.

Required.