---
title: clearBarrier()
framework: metal
role: symbol
role_heading: Instance Method
path: metal/mtlindirectcomputecommand/clearbarrier()
---

# clearBarrier()

Removes any barrier set on the command.

## Declaration

```swift
func clearBarrier()
```

## Discussion

Discussion You need to set or clear barriers (as needed) before executing any of the commands in the indirect command buffer.

## See Also

### Synchronizing command execution

- [setBarrier()](metal/mtlindirectcomputecommand/setbarrier().md)
