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

# heapAccelerationStructureSizeAndAlign(descriptor:)

Returns the size and alignment, in bytes, of an acceleration structure if you create it from a heap with a descriptor.

## Declaration

```swift
func heapAccelerationStructureSizeAndAlign(descriptor: MTLAccelerationStructureDescriptor) -> MTLSizeAndAlign
```

## Parameters

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

## Return Value

Return Value An MTLSizeAndAlign instance.

## Discussion

Discussion Use this method to help estimate an appropriate size for a new heap before you create it.

## See Also

### Working with resource heaps

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