---
title: "copy(to:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/textureresource/copy(to:)"
---

# copy(to:)

Asynchronously copies texture data to another texture.

## Declaration

```swift
@MainActor @preconcurrency func copy(to texture: any MTLTexture) async throws
```

## Parameters

- `texture`: The target texture for copying the data. It needs to have the same width and height as doc://com.apple.RealityKit/documentation/RealityKit/TextureResource, and doc://com.apple.documentation/documentation/Metal/MTLTextureUsage/shaderWrite usage.

## Discussion

Discussion This method copies all available mipmap sizes to texture. It’s recommended that you provide a value for semantic when creating this resource. Specifying a semantic enables RealityKit to select an appropriate pixel format for the target texture.
