---
title: "setObjectBuffers:offsets:withRange:"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/setobjectbuffers:offsets:withrange:"
---

# setObjectBuffers:offsets:withRange:

Encodes a command that assigns multiple buffers to a range of entries in the object shader argument table.

## Declaration

```occ
- (void) setObjectBuffers:(id<MTLBuffer> const[]) buffers offsets:(const NSUInteger[]) offsets withRange:(NSRange) range;
```

## Parameters

- `buffers`: A pointer to a C array of doc://com.apple.metal/documentation/Metal/MTLBuffer instances the command assigns to entries in the object shader argument table for buffers.
- `offsets`: A pointer to a C array of unsigned integers. Each element represents the location, in bytes, from the start of the corresponding doc://com.apple.metal/documentation/Metal/MTLBuffer element in buffers where the object shader argument data begins. See the https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf to check for offset alignment requirements for buffers in device and constant address space.
- `range`: A span of integers that represent the entries in the object shader argument table for buffers. Each entry stores a record of the corresponding element in buffers and offsets.

## Discussion

Discussion By default, the texture at each index is nil. note: The Swift version of this method is setObjectBuffers(_:offsets:range:).

## See Also

### Assigning buffers for object shaders

- [setObjectBuffer(_:offset:index:)](metal/mtlrendercommandencoder/setobjectbuffer(_:offset:index:).md)
- [setObjectBytes(_:length:index:)](metal/mtlrendercommandencoder/setobjectbytes(_:length:index:).md)
- [setObjectBufferOffset(_:index:)](metal/mtlrendercommandencoder/setobjectbufferoffset(_:index:).md)
