---
title: MTLIOCommandBuffer
framework: metal
role: symbol
role_heading: Protocol
path: metal/mtliocommandbuffer
---

# MTLIOCommandBuffer

A command buffer that contains input/output commands that work with files in the file systems and Metal resources.

## Declaration

```swift
protocol MTLIOCommandBuffer : NSObjectProtocol
```

## Overview

Overview Add commands an input/output command buffer to load assets from the file system directly into Metal resources. Your app can then use those resources with other commands it submits to MTLCommandQueue.

## Topics

### Loading assets

- [load(_:offset:size:sourceHandle:sourceHandleOffset:)](metal/mtliocommandbuffer/load(_:offset:size:sourcehandle:sourcehandleoffset:).md)
- [load(_:slice:level:size:sourceBytesPerRow:sourceBytesPerImage:destinationOrigin:sourceHandle:sourceHandleOffset:)](metal/mtliocommandbuffer/load(_:slice:level:size:sourcebytesperrow:sourcebytesperimage:destinationorigin:sourcehandle:sourcehandleoffset:).md)
- [loadBytes(_:size:sourceHandle:sourceHandleOffset:)](metal/mtliocommandbuffer/loadbytes(_:size:sourcehandle:sourcehandleoffset:).md)

### Adding a barrier

- [addBarrier()](metal/mtliocommandbuffer/addbarrier().md)

### Synchronizing a command buffer

- [signalEvent(_:value:)](metal/mtliocommandbuffer/signalevent(_:value:).md)
- [waitForEvent(_:value:)](metal/mtliocommandbuffer/waitforevent(_:value:).md)

### Adding final commands

- [copyStatus(buffer:offset:)](metal/mtliocommandbuffer/copystatus(buffer:offset:).md)
- [addCompletedHandler(_:)](metal/mtliocommandbuffer/addcompletedhandler(_:).md)

### Submitting a command buffer

- [commit()](metal/mtliocommandbuffer/commit().md)
- [enqueue()](metal/mtliocommandbuffer/enqueue().md)

### Canceling a command buffer

- [tryCancel()](metal/mtliocommandbuffer/trycancel().md)

### Waiting for a command buffer

- [waitUntilCompleted()](metal/mtliocommandbuffer/waituntilcompleted().md)

### Checking the state of a command buffer

- [status](metal/mtliocommandbuffer/status.md)
- [error](metal/mtliocommandbuffer/error.md)

### Debugging a command buffer

- [label](metal/mtliocommandbuffer/label.md)
- [pushDebugGroup(_:)](metal/mtliocommandbuffer/pushdebuggroup(_:).md)
- [popDebugGroup()](metal/mtliocommandbuffer/popdebuggroup().md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### I/O command buffers

- [MTLIOFileHandle](metal/mtliofilehandle.md)
- [MTLIOCommandBufferHandler](metal/mtliocommandbufferhandler.md)
- [MTLIOStatus](metal/mtliostatus.md)
- [MTLIOError.Code](metal/mtlioerror-swift.struct/code.md)
- [MTLIOErrorDomain](metal/mtlioerrordomain.md)
