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