---
title: "setTextures(_:range:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlargumentencoder/settextures(_:range:)"
---

# setTextures(_:range:)

Encodes references to an array of textures into the argument buffer.

## Declaration

```swift
func setTextures(_ textures: [(any MTLTexture)?], range: Range<Int>)
```

## Parameters

- `textures`: An array of textures the method encodes.
- `range`: A range of indices within the argument buffer for each element in textures. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the doc://com.apple.metal/documentation/Metal/MTLArgumentDescriptor/index property of doc://com.apple.metal/documentation/Metal/MTLArgumentDescriptor instances.

## See Also

### Encoding textures

- [setTexture(_:index:)](metal/mtlargumentencoder/settexture(_:index:).md)
