---
title: "setTileTexture(_:index:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/settiletexture(_:index:)"
---

# setTileTexture(_:index:)

Assigns a texture to an entry in the tile shader argument table.

## Declaration

```swift
func setTileTexture(_ texture: (any MTLTexture)?, index: Int)
```

## Parameters

- `texture`: An doc://com.apple.metal/documentation/Metal/MTLTexture instance the command assigns to an entry in the tile shader argument table for textures.
- `index`: An integer that represents the entry in the tile shader argument table for textures that stores a record of texture.

## Discussion

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

## See Also

### Assigning textures

- [setTileTextures(_:range:)](metal/mtlrendercommandencoder/settiletextures(_:range:).md)
