---
title: "makeTexture(descriptor:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlheap/maketexture(descriptor:)"
---

# makeTexture(descriptor:)

Creates a texture on the heap.

## Declaration

```swift
func makeTexture(descriptor: MTLTextureDescriptor) -> (any MTLTexture)?
```

## Parameters

- `descriptor`: A descriptor object that describes the properties of the texture.

## Return Value

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

## Discussion

Discussion You can call the method with the following restrictions: The heap’s type needs to be MTLHeapType.automatic The texture’s CPU cache mode option needs to match the heap’s cpuCacheMode property The texture’s storage mode option needs to be MTLStorageMode.memoryless, or match the heap’s storageMode property

## See Also

### Creating textures from a heap

- [makeTexture(descriptor:offset:)](metal/mtlheap/maketexture(descriptor:offset:).md)
