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

# heapAccelerationStructureSizeAndAlign(size:)

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

## Declaration

```swift
func heapAccelerationStructureSizeAndAlign(size: Int) -> MTLSizeAndAlign
```

## Parameters

- `size`: The size of an acceleration structure, in bytes.

## 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(descriptor:)](metal/mtldevice/heapaccelerationstructuresizeandalign(descriptor:).md)
- [MTLSizeAndAlign](metal/mtlsizeandalign.md)
