---
title: "setTexture(_:index:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4argumenttable/settexture(_:index:)"
---

# setTexture(_:index:)

Binds a texture to a texture binding slot.

## Declaration

```swift
func setTexture(_ resourceID: MTLResourceID, index bindingIndex: Int)
```

## Parameters

- `resourceID`: The doc://com.apple.metal/documentation/Metal/MTLResourceID of the doc://com.apple.metal/documentation/Metal/MTLTexture instance to bind.
- `bindingIndex`: A valid binding index in the texture binding range. It is an error for this value to match or exceed the value of property doc://com.apple.metal/documentation/Metal/MTL4ArgumentTableDescriptor/maxTextureBindCount on the descriptor from which you created this argument table.
