---
title: "setTextureView(texture:index:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtltextureviewpool/settextureview(texture:index:)"
---

# setTextureView(texture:index:)

Copies a default texture view to a slot in this texture view pool at an index provided.

## Declaration

```swift
func setTextureView(texture: any MTLTexture, index: Int) -> MTLResourceID
```

## Parameters

- `texture`: An doc://com.apple.metal/documentation/Metal/MTLTexture instance for which to copy its texture view.
- `index`: An index of a slot in this texture pool into which this method copies the texture view.

## Return Value

Return Value The MTLResourceID of a newly created texture view in this pool.
