<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 - 27.0.0",
    "macOS: 10.11.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLBlitCommandEncoder/synchronize(texture:slice:level:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLBlitCommandEncoder(im)synchronizeTexture:slice:level:"
  },
  "title" : "synchronize(texture:slice:level:)"
}
-->

# synchronize(texture:slice:level:)

Encodes a command that synchronizes a part of the CPU’s copy of a texture so that it matches the GPU’s copy.

```
func synchronize(texture: any MTLTexture, slice: Int, level: Int)
```

## Parameters

`texture`

An [`MTLTexture`](/documentation/Metal/MTLTexture) instance with a [`storageMode`](/documentation/Metal/MTLResource/storageMode) property that’s equal to [`MTLStorageMode.managed`](/documentation/Metal/MTLStorageMode/managed).

`slice`

A slice within `texture`.

`level`

A mipmap level within `texture`.

## Discussion

This method ensures the CPU can correctly read the changes a GPU makes to a slice of a texture that uses the managed storage mode. For the resources you create with [`MTLStorageMode.managed`](/documentation/Metal/MTLStorageMode/managed), the CPU and GPU each have a copy of that resource. As the GPU modifies its copy, the CPU’s copy remains unchanged until you synchronize with a command, such as this one.

The CPU can access the updated content from its copy of the texture after the synchronization command completes.

> Note:
> The command this method encodes behaves similarly to the command that ``doc://com.apple.metal/documentation/Metal/MTLBlitCommandEncoder/synchronize(resource:)`` encodes, except that it flushes only the applicable slice and mipmap level.

---

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)