Contents

copy(to:)

Asynchronously copies texture data to another texture.

Declaration

@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, and Shaderwrite usage.

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.