<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLHeap/makeTexture(descriptor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLHeap(im)newTextureWithDescriptor:"
  },
  "title" : "makeTexture(descriptor:)"
}
-->

# makeTexture(descriptor:)

Creates a texture on the heap.

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

## Parameters

`descriptor`

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

You can call the method with the following restrictions:

- The heap’s type needs to be [`MTLHeapType.automatic`](/documentation/Metal/MTLHeapType/automatic)
- The texture’s CPU cache mode option needs to match the heap’s [`cpuCacheMode`](/documentation/Metal/MTLHeap/cpuCacheMode) property
- The texture’s storage mode option needs to be [`MTLStorageMode.memoryless`](/documentation/Metal/MTLStorageMode/memoryless), or match the heap’s [`storageMode`](/documentation/Metal/MTLHeap/storageMode) property

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)