<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRenderCommandEncoder/setObjectBuffers(_:offsets:range:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So23MTLRenderCommandEncoderP5MetalE16setObjectBuffers_7offsets5rangeySaySo9MTLBuffer_pSgG_SaySiGSnySiGtF"
  },
  "title" : "setObjectBuffers(_:offsets:range:)"
}
-->

# setObjectBuffers(_:offsets:range:)

Assigns multiple buffers to a range of entries in the object shader argument table.

```
func setObjectBuffers(_ buffers: [(any MTLBuffer)?], offsets: [Int], range: Range<Int>)
```

## Parameters

`buffers`

An array of [`MTLBuffer`](/documentation/Metal/MTLBuffer) instances the command assigns to entries in the object shader argument table for buffers.

`offsets`

An array of integers. Each element represents the location, in bytes, from the start of the corresponding [`MTLBuffer`](/documentation/Metal/MTLBuffer) element in `buffers` where the object shader argument data begins.

    See the     [Metal feature set tables (PDF)](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

By default, the texture at each index is `nil`.

> Note:
> The Objective-C version of this method is ``doc://com.apple.metal/documentation/Metal/MTLRenderCommandEncoder/setObjectBuffers:offsets:withRange:``.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)