optimizeContents(forGPUAccess:)
Encodes a command that modifies the contents of a texture to improve the performance of GPU accesses to its contents.
Declaration
func optimizeContents(forGPUAccess texture: any MTLTexture)Parameters
- texture:
A Mtltexture instance the command optimizes for GPU access.
Discussion
Optimizing a texture for GPU access may affect the performance of CPU accesses, however, the data the CPU retrieves from the texture remains consistent.
You typically run this command for:
Textures the GPU accesses for an extended period of time.
Textures with a storageMode property that’s MTLStorageMode.shared or MTLStorageMode.managed.