<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/TextureResource/copy(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation15TextureResourceC4copy2toySo10MTLTexture_p_tYaKF::OverloadGroup"
  },
  "title" : "copy(to:)"
}
-->

# copy(to:)

Asynchronously copies texture data to another texture.

```
@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 [`TextureResource`](/documentation/RealityKit/TextureResource), and
<doc://com.apple.documentation/documentation/Metal/MTLTextureUsage/shaderWrite> usage.

## Discussion

This method copies all available mipmap sizes to `texture`.

It’s recommended that you provide a value for [`semantic`](/documentation/RealityKit/TextureResource/CreateOptions/semantic) when creating this resource. Specifying a
semantic enables RealityKit to select an appropriate pixel format for the target texture.

---

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)