---
title: "makeHeap(descriptor:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtldevice/makeheap(descriptor:)"
---

# makeHeap(descriptor:)

Creates a new GPU heap instance.

## Declaration

```swift
func makeHeap(descriptor: MTLHeapDescriptor) -> (any MTLHeap)?
```

## Parameters

- `descriptor`: An doc://com.apple.metal/documentation/Metal/MTLHeapDescriptor instance.

## Return Value

Return Value A new MTLHeap instance if the method completed successfully; otherwise nil.

## Discussion

Discussion For more information about using heaps, see Memory heaps.

## See Also

### Working with resource heaps

- [heapBufferSizeAndAlign(length:options:)](metal/mtldevice/heapbuffersizeandalign(length:options:).md)
- [heapTextureSizeAndAlign(descriptor:)](metal/mtldevice/heaptexturesizeandalign(descriptor:).md)
- [heapAccelerationStructureSizeAndAlign(size:)](metal/mtldevice/heapaccelerationstructuresizeandalign(size:).md)
- [heapAccelerationStructureSizeAndAlign(descriptor:)](metal/mtldevice/heapaccelerationstructuresizeandalign(descriptor:).md)
- [MTLSizeAndAlign](metal/mtlsizeandalign.md)
