---
title: makeFence()
framework: metal
role: symbol
role_heading: Instance Method
path: metal/mtldevice/makefence()
---

# makeFence()

Creates a new memory fence instance.

## Declaration

```swift
func makeFence() -> (any MTLFence)?
```

## Mentioned in

Synchronizing passes with a fence

## See Also

### Creating fences and events

- [makeEvent()](metal/mtldevice/makeevent().md)
- [makeSharedEvent()](metal/mtldevice/makesharedevent().md)
- [makeSharedEvent(handle:)](metal/mtldevice/makesharedevent(handle:).md)
