---
title: "setArgumentBuffer(_:offset:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlargumentencoder/setargumentbuffer(_:offset:)"
---

# setArgumentBuffer(_:offset:)

Specifies the position in a buffer where the encoder writes argument data.

## Declaration

```swift
func setArgumentBuffer(_ argumentBuffer: (any MTLBuffer)?, offset: Int)
```

## Parameters

- `argumentBuffer`: The destination buffer that represents an argument buffer.
- `offset`: The byte offset of the buffer.

## See Also

### Creating an argument buffer

- [setArgumentBuffer(_:startOffset:arrayElement:)](metal/mtlargumentencoder/setargumentbuffer(_:startoffset:arrayelement:).md)
- [encodedLength](metal/mtlargumentencoder/encodedlength.md)
