Instance Method

synchronizeResource:

Encodes a command to synchronize the contents of a managed resource from the GPU to the CPU.

Required.

Declaration

- (void)synchronizeResource:(id<MTLResource>)resource;

Parameters

resource

The resource to synchronize. The resource must have a MTLStorageModeManaged storage mode.

Discussion

When the GPU modifies a managed resource, Metal guarantees that the changes are visible to future accesses by the GPU. If you try to read the resource on the CPU, the results are undefined. To make the changes visible to the CPU, encode a synchronization command. After the synchronization command completes, the CPU can access the contents of the resource.

See Also

Synchronizing Managed Resources to the CPU

- synchronizeTexture:slice:level:

Encodes a command to synchronize part of a managed texture from the GPU to the CPU.

Required.