Encodes a command to optimize part of a texture for better performance when the CPU accesses it.
- iOS 12.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- tvOS 12.0+
The texture to optimize.
The slice within the texture to optimize.
A mipmap level of the texture.
You can access shared and managed textures from both the CPU and the GPU. If you will access a texture from the CPU for an extended period of time, this method to optimize access to the texture from the CPU.
When this command is executed, the Metal device can make changes to the resource to improve performance on the CPU, so long as those changes do not result in a loss of data. The GPU can still read data stored in this texture, and will get the same results, but possibly at a performance penalty.