---
title: "setTexture(_:at:)"
framework: Compute Graph
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "computegraph/computegraphsimulation/settexture(_:at:)"
---

# setTexture(_:at:)

Binds a Metal texture to the texture slot at the given index.

## Declaration

```swift
final func setTexture(_ texture: (any MTLTexture)?, at index: Int)
```

## Parameters

- `texture`: The MTLTexture to bind, or nil to clear.
- `index`: The zero-based slot index.
