<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLTextureViewPool/setTextureView(texture:index:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLTextureViewPool(im)setTextureView:atIndex:"
  },
  "title" : "setTextureView(texture:index:)"
}
-->

# setTextureView(texture:index:)

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

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

## Parameters

`texture`

An [`MTLTexture`](/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

The [`MTLResourceID`](/documentation/Metal/MTLResourceID) of a newly created texture view in this pool.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)