<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLBlitCommandEncoder/copy(from:sourceSlice:sourceLevel:to:destinationSlice:destinationLevel:sliceCount:levelCount:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLBlitCommandEncoder(im)copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount:"
  },
  "title" : "copy(from:sourceSlice:sourceLevel:to:destinationSlice:destinationLevel:sliceCount:levelCount:)"
}
-->

# copy(from:sourceSlice:sourceLevel:to:destinationSlice:destinationLevel:sliceCount:levelCount:)

Encodes a command that copies slices of a texture to another texture’s slices.

```
func copy(from sourceTexture: any MTLTexture, sourceSlice: Int, sourceLevel: Int, to destinationTexture: any MTLTexture, destinationSlice: Int, destinationLevel: Int, sliceCount: Int, levelCount: Int)
```

## Parameters

`sourceTexture`

A texture the command copies data from.

`sourceSlice`

A slice within `sourceTexture` the command uses as a starting point to copy data from.

    Set this to     `0`     if     `sourceTexture`     isn’t a texture array or a cube texture.

`sourceLevel`

A mipmap level within `sourceTexture`.

`destinationTexture`

Another texture the command copies the data to that has the same pixel format and sample count as `sourceTexture`.

`destinationSlice`

A slice within `destinationTexture` the command uses as its starting point for coping data.

    Set this to     `0`     if     `destinationTexture`     isn’t a texture array or a cube texture.

`destinationLevel`

A mipmap level within `destinationTexture` that has the same size as the source texture’s `sourceLevel` mipmap.

`sliceCount`

The number of slices the command copies so that it satisfies these conditions:

- The sum of `sourceLevel` and `sourceSlice` doesn’t exceed the number of slices in `sourceTexture`.
- The sum of `destinationLevel` and `destinationSlice` doesn’t exceed the number of slices in `destinationTexture`.

`levelCount`

The number of mipmap levels the command copies so that it satisfies these conditions:

- The sum of `levelCount` and `sourceLevel` doesn’t exceed the number of mipmap levels in `sourceTexture`.
- The sum of `levelCount` and `destinationLevel` doesn’t exceed the number of mipmap levels in `destinationTexture`.

## Discussion

---

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)